diff --git a/pages/sessions/basic-api/redis.md b/pages/sessions/basic-api/redis.md index e4fa91c..975e674 100644 --- a/pages/sessions/basic-api/redis.md +++ b/pages/sessions/basic-api/redis.md @@ -25,7 +25,7 @@ export async function createSession(token: string, userId: number): Promise { +export async function validateSessionToken(token: string): Promise { // TODO } @@ -72,7 +72,7 @@ import { sha256 } from "@oslojs/crypto/sha2"; // ... -export async function createSession(token: string, userId: number): Session { +export async function createSession(token: string, userId: number): Promise { const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token))); const session: Session = { id: sessionId, @@ -108,7 +108,7 @@ import { sha256 } from "@oslojs/crypto/sha2"; // ... -export async function validateSessionToken(token: string): Promise { +export async function validateSessionToken(token: string): Promise { const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token))); const item = await redis.get(`session:${sessionId}`); if (item === null) { @@ -168,7 +168,7 @@ export function generateSessionToken(): string { return token; } -export async function createSession(token: string, userId: number): Session { +export async function createSession(token: string, userId: number): Promise { const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token))); const session: Session = { id: sessionId, @@ -189,7 +189,7 @@ export async function createSession(token: string, userId: number): Session { return session; } -export async function validateSessionToken(token: string): Promise { +export async function validateSessionToken(token: string): Promise { const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token))); const item = await redis.get(`session:${sessionId}`); if (item === null) {