feat(lst): added icons to the sidebar
This commit is contained in:
@@ -3,7 +3,7 @@ import {verify} from "hono/jwt";
|
||||
|
||||
const session = new OpenAPIHono();
|
||||
const tags = ["Auth"];
|
||||
const JWT_SECRET = "your-secret-key";
|
||||
const JWT_SECRET = process.env.JWT_SECRET;
|
||||
|
||||
const route = createRoute({
|
||||
tags: ["Auth"],
|
||||
@@ -21,6 +21,14 @@ const route = createRoute({
|
||||
},
|
||||
description: "Login successful",
|
||||
},
|
||||
401: {
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: {message: ""},
|
||||
},
|
||||
},
|
||||
description: "Error of why you were not logged in.",
|
||||
},
|
||||
},
|
||||
});
|
||||
session.openapi(route, async (c) => {
|
||||
@@ -39,7 +47,7 @@ session.openapi(route, async (c) => {
|
||||
|
||||
try {
|
||||
const payload = await verify(token, JWT_SECRET);
|
||||
console.log(payload);
|
||||
//console.log(payload);
|
||||
return c.json({data: {token, user: payload.user}});
|
||||
} catch (err) {
|
||||
return c.json({error: "Invalid or expired token"}, 401);
|
||||
|
||||
Reference in New Issue
Block a user