fix: use @keivusal/auth module
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useConfig } from '@abearxiong/use-config';
|
||||
import { sequelize } from '@/modules/sequelize.ts';
|
||||
import { DataTypes, Model, Op } from 'sequelize';
|
||||
import { createToken, checkToken } from '@abearxiong/auth/token';
|
||||
import { cryptPwd } from '@abearxiong/auth';
|
||||
import { createToken, checkToken } from '@kevisual/auth/token';
|
||||
import { cryptPwd } from '@kevisual/auth';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { CustomError } from '@kevisual/router';
|
||||
import { Org } from './org.ts';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import './routes/index.ts';
|
||||
import { app } from './app.ts';
|
||||
import { useConfig } from '@abearxiong/use-config';
|
||||
import { createAuthRoute } from '@abearxiong/auth';
|
||||
import { createAuthRoute } from '@kevisual/auth';
|
||||
const config = useConfig<{ tokenSecret: string }>();
|
||||
|
||||
createAuthRoute({
|
||||
|
||||
@@ -20,7 +20,7 @@ app
|
||||
...searchWhere,
|
||||
},
|
||||
limit: pageSize,
|
||||
offset: page * pageSize,
|
||||
offset: (page - 1) * pageSize,
|
||||
});
|
||||
ctx.body = {
|
||||
pagination: {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { app } from '@/app.ts';
|
||||
import { Org } from '@/models/org.ts';
|
||||
import { User } from '@/models/user.ts';
|
||||
import { CustomError } from '@kevisual/router';
|
||||
|
||||
app
|
||||
.route({
|
||||
path: 'user',
|
||||
key: 'me',
|
||||
middleware: ['auth'],
|
||||
isDebug: true,
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
const tokenUser = ctx.state?.tokenUser || {};
|
||||
|
||||
Reference in New Issue
Block a user