fix
This commit is contained in:
parent
c482092961
commit
10600571d3
@ -8,7 +8,7 @@ import { domain } from '@/modules/domain.ts';
|
||||
* @param ctx
|
||||
* @returns
|
||||
*/
|
||||
const createCookie = (token: any, ctx: any) => {
|
||||
export const createCookie = (token: any, ctx: any) => {
|
||||
if (!domain) {
|
||||
return;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import jsonwebtoken from 'jsonwebtoken';
|
||||
|
||||
// const tokenData: Record<string, string> = {};
|
||||
import { redis } from '@/app.ts';
|
||||
import { createCookie } from './me.ts';
|
||||
|
||||
app
|
||||
.route({
|
||||
@ -79,9 +80,10 @@ app
|
||||
// const data = tokenData[loginToken];
|
||||
const data = await redis.get(loginToken);
|
||||
if (data) {
|
||||
ctx.body = data;
|
||||
ctx.body = { token: data, expireTime: 0 };
|
||||
} else {
|
||||
ctx.throw(400, 'Checked Failed');
|
||||
}
|
||||
createCookie(data, ctx);
|
||||
})
|
||||
.addTo(app);
|
||||
|
Loading…
x
Reference in New Issue
Block a user