improvements
This commit is contained in:
@@ -112,7 +112,7 @@ export const Route = createFileRoute("/api/spotify/callback")({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const isSecure = import.meta.env.NODE_ENV === "production";
|
const isSecure = import.meta.env.NODE_ENV === "production";
|
||||||
const cookieOptions = `HttpOnly; Secure=${isSecure}; SameSite=Strict; Path=/; Max-Age=${tokens.expires_in}`;
|
const cookieOptions = `HttpOnly; ${isSecure ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${tokens.expires_in}`;
|
||||||
|
|
||||||
response.headers.append(
|
response.headers.append(
|
||||||
"Set-Cookie",
|
"Set-Cookie",
|
||||||
@@ -120,7 +120,7 @@ export const Route = createFileRoute("/api/spotify/callback")({
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (tokens.refresh_token) {
|
if (tokens.refresh_token) {
|
||||||
const refreshCookieOptions = `HttpOnly; Secure=${isSecure}; SameSite=Strict; Path=/; Max-Age=${60 * 60 * 24 * 30}`; // 30 days
|
const refreshCookieOptions = `HttpOnly; ${isSecure ? 'Secure; ' : ''}SameSite=Lax; Path=/; Max-Age=${60 * 60 * 24 * 30}`; // 30 days
|
||||||
response.headers.append(
|
response.headers.append(
|
||||||
"Set-Cookie",
|
"Set-Cookie",
|
||||||
`spotify_refresh_token=${tokens.refresh_token}; ${refreshCookieOptions}`
|
`spotify_refresh_token=${tokens.refresh_token}; ${refreshCookieOptions}`
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export const MatchForm: React.FC<MatchFormProps> = ({
|
|||||||
{match.home?.name} Cups
|
{match.home?.name} Cups
|
||||||
</Text>
|
</Text>
|
||||||
{
|
{
|
||||||
match.home?.players.map(p => (<Text size='xs' c='dimmed'>
|
match.home?.players?.map(p => (<Text key={p.id} size='xs' c='dimmed'>
|
||||||
{p.first_name} {p.last_name}
|
{p.first_name} {p.last_name}
|
||||||
</Text>))
|
</Text>))
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ export const MatchForm: React.FC<MatchFormProps> = ({
|
|||||||
{match.away?.name} Cups
|
{match.away?.name} Cups
|
||||||
</Text>
|
</Text>
|
||||||
{
|
{
|
||||||
match.away?.players.map(p => (<Text size='xs' c='dimmed'>
|
match.away?.players?.map(p => (<Text key={p.id} size='xs' c='dimmed'>
|
||||||
{p.first_name} {p.last_name}
|
{p.first_name} {p.last_name}
|
||||||
</Text>))
|
</Text>))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const MatchSlot: React.FC<MatchSlotProps> = ({
|
|||||||
<Text
|
<Text
|
||||||
size={team.name.length > 12 ? (team.name.length > 18 ? '10px' : '11px') : 'xs'}
|
size={team.name.length > 12 ? (team.name.length > 18 ? '10px' : '11px') : 'xs'}
|
||||||
truncate
|
truncate
|
||||||
style={{ minWidth: 0, flex: 1 }}
|
style={{ minWidth: 0, flex: 1, lineHeight: "12px" }}
|
||||||
>
|
>
|
||||||
{team.name}
|
{team.name}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ export const SeedBadge: React.FC<SeedBadgeProps> = ({ seed }) => {
|
|||||||
color: "var(--mantine-color-text)",
|
color: "var(--mantine-color-text)",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center"
|
justifyContent: "center",
|
||||||
|
borderTopLeftRadius: "var(--mantine-radius-default)",
|
||||||
|
borderBottomLeftRadius: "var(--mantine-radius-default)",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{seed}
|
{seed}
|
||||||
|
|||||||
@@ -36,9 +36,6 @@ const Navbar = () => {
|
|||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
</AppShell.Section>
|
</AppShell.Section>
|
||||||
<AppShell.Section>
|
|
||||||
<Link to="/logout">Logout</Link>
|
|
||||||
</AppShell.Section>
|
|
||||||
</AppShell.Navbar>
|
</AppShell.Navbar>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user