Skip to content

Commit a3beca0

Browse files
authored
Corrected hashSecret return type in basic.md (#1814)
1 parent fd5fb06 commit a3beca0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pages/sessions/basic.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async function validateSessionToken(dbPool: DBPool, token: string): Promise<Sess
133133

134134
const session = await getSession(dbPool, sessionId);
135135

136-
const tokenSecretHash = hashSecret(sessionSecret);
136+
const tokenSecretHash = await hashSecret(sessionSecret);
137137
const validSecret = constantTimeEqual(tokenSecretHash, session.secretHash);
138138
if (!validSecret) {
139139
return null;
@@ -173,7 +173,7 @@ async function deleteSession(dbPool: DBPool, sessionId: string): Promise<void> {
173173
await executeQuery(dbPool, "DELETE FROM session WHERE id = ?", [sessionId]);
174174
}
175175

176-
async function hashSecret(secret: string): Uint8Array {
176+
async function hashSecret(secret: string): Promise<Uint8Array> {
177177
// ...
178178
}
179179

0 commit comments

Comments
 (0)