mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-08 22:05:12 +00:00
Fix guess's sub/sid format
This commit is contained in:
+14
-6
@@ -35,13 +35,21 @@ export const auth = new Elysia({ name: "auth" })
|
||||
});
|
||||
}
|
||||
|
||||
// @ts-expect-error ts can't understand that there's two overload idk why
|
||||
const { payload } = await jwtVerify(bearer, jwtSecret ?? jwks, {
|
||||
issuer: process.env.JWT_ISSUER,
|
||||
});
|
||||
const jwt = validator.Decode(payload);
|
||||
try {
|
||||
// @ts-expect-error ts can't understand that there's two overload idk why
|
||||
const { payload } = await jwtVerify(bearer, jwtSecret ?? jwks, {
|
||||
issuer: process.env.JWT_ISSUER,
|
||||
});
|
||||
const jwt = validator.Decode(payload);
|
||||
|
||||
return { jwt };
|
||||
return { jwt };
|
||||
} catch (err) {
|
||||
return error(403, {
|
||||
status: 403,
|
||||
message: "Invalid jwt. Verification vailed",
|
||||
details: err,
|
||||
});
|
||||
}
|
||||
})
|
||||
.macro({
|
||||
permissions(perms: string[]) {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
Column,
|
||||
type Column,
|
||||
type ColumnsSelection,
|
||||
type SQL,
|
||||
type SQLWrapper,
|
||||
|
||||
Reference in New Issue
Block a user