Skip to content

Commit 88f7e7d

Browse files
committed
[Update] Simplify login check and always set active account cookie (#4442)
1 parent cab83fb commit 88f7e7d

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

apps/dashboard/src/app/login/auth-actions.ts

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,14 @@ export async function isLoggedIn(address: string) {
196196
cookieStore.delete(cookieName);
197197
return false;
198198
}
199-
// if the address matches what we expect, we're logged in
200-
if (getAddress(json.data.creatorWalletAddress) === getAddress(address)) {
201-
// set the active account cookie again
202-
cookieStore.set(COOKIE_ACTIVE_ACCOUNT, getAddress(address), {
203-
httpOnly: false,
204-
secure: true,
205-
sameSite: "strict",
206-
// 3 days
207-
maxAge: 3 * 24 * 60 * 60,
208-
});
209-
return true;
210-
}
211199

212-
// not logged in
213-
// clear the cookie
214-
cookieStore.delete(cookieName);
215-
return false;
200+
// set the active account cookie again
201+
cookieStore.set(COOKIE_ACTIVE_ACCOUNT, getAddress(address), {
202+
httpOnly: false,
203+
secure: true,
204+
sameSite: "strict",
205+
// 3 days
206+
maxAge: 3 * 24 * 60 * 60,
207+
});
208+
return true;
216209
}

0 commit comments

Comments
 (0)