Skip to content

Commit

Permalink
app routes room $roomId player: only mark solve if logged in
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnord committed Sep 16, 2023
1 parent 339bf37 commit 00a8a59
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/routes/room.$roomId.player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ export async function action({ request, params }: ActionArgs) {

const authSession = await getValidAuthSession(request);
// Mark the game as started if it hasn't been already
if (request.method === "POST") {
if (authSession && request.method === "POST") {
const solve = await getSolve(
userId,
authSession.userId,
room.game_id,
authSession?.accessToken,
authSession.accessToken,
);
if (!solve) {
await markAttempted(
userId,
authSession.userId,
room.game_id,
room.id,
authSession?.accessToken,
authSession.accessToken,
);
}
}
Expand Down

1 comment on commit 00a8a59

@vercel
Copy link

@vercel vercel bot commented on 00a8a59 Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.