Skip to content

Commit

Permalink
create gamemode cookie on login
Browse files Browse the repository at this point in the history
  • Loading branch information
AkinariHex committed Apr 1, 2024
1 parent 7c78f58 commit b05c50d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ export async function login(cookie: {
session.scopes = loggedUser.scopes;
session.isLogged = true;

await cookies().set('OTR-user-selected-osu-mode', loggedUser.osuPlayMode, {
httpOnly: true,
path: '/',
sameSite: 'strict',
secure: process.env.NODE_ENV === 'production',
maxAge: 1209600,
});

await session.save();

/* await changeOsuModeCookie(res.osuPlayMode); */
Expand Down
1 change: 1 addition & 0 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export default async function page({

if (!data.generalStats || !data.playerInfo) {
throw Error('4');
return;
}

return (
Expand Down

0 comments on commit b05c50d

Please sign in to comment.