Skip to content

Commit 760c134

Browse files
committed
fix anonymous login logic
1 parent 00241f7 commit 760c134

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/routes/_index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ export default function Page() {
55
const navigate = useNavigate();
66
const anonymousLoginAndStart = async () => {
77
const user = await authClient.getSession();
8-
if (!user.data) {
9-
const _user = await authClient.signIn.anonymous();
8+
if (user.data) {
9+
const _user = await authClient.signOut();
1010
}
11+
const _user = await authClient.signIn.anonymous();
1112
navigate("/play");
1213
};
1314
return (

0 commit comments

Comments
 (0)