Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 30, 2024
1 parent a44495a commit d898ba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pages/sessions/basic-api/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export async function validateSessionToken(token: string): Promise<SessionValida
};
if (Date.now() >= session.expiresAt.getTime()) {
await db.execute("DELETE FROM user_session WHERE id = ?", session.id);
return null;
return { session: null, user: null };
}
if (Date.now() >= session.expiresAt.getTime() - 1000 * 60 * 60 * 24 * 15) {
session.expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30);
Expand Down Expand Up @@ -230,7 +230,7 @@ export async function validateSessionToken(token: string): Promise<SessionValida
};
if (Date.now() >= session.expiresAt.getTime()) {
await db.execute("DELETE FROM user_session WHERE id = ?", session.id);
return null;
return { session: null, user: null };
}
if (Date.now() >= session.expiresAt.getTime() - 1000 * 60 * 60 * 24 * 15) {
session.expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30);
Expand Down
4 changes: 2 additions & 2 deletions pages/sessions/basic-api/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export async function validateSessionToken(token: string): Promise<SessionValida
};
if (Date.now() >= session.expiresAt.getTime()) {
await db.execute("DELETE FROM user_session WHERE id = ?", session.id);
return null;
return { session: null, user: null };
}
if (Date.now() >= session.expiresAt.getTime() - 1000 * 60 * 60 * 24 * 15) {
session.expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30);
Expand Down Expand Up @@ -230,7 +230,7 @@ export async function validateSessionToken(token: string): Promise<SessionValida
};
if (Date.now() >= session.expiresAt.getTime()) {
await db.execute("DELETE FROM user_session WHERE id = ?", session.id);
return null;
return { session: null, user: null };
}
if (Date.now() >= session.expiresAt.getTime() - 1000 * 60 * 60 * 24 * 15) {
session.expiresAt = new Date(Date.now() + 1000 * 60 * 60 * 24 * 30);
Expand Down

0 comments on commit d898ba9

Please sign in to comment.