Skip to content

Commit

Permalink
fix: login auth
Browse files Browse the repository at this point in the history
  • Loading branch information
wmui committed Jun 25, 2023
1 parent b0d93ba commit 32f0f6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controller/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class UserController extends BaseController {
async login() {
const { user } = this.ctx.service;
const body = this.ctx.request.body;
const admin = user.login(body);
const admin = await user.login(body);

if (admin) {
const token = this.ctx.service.user.sign({
Expand Down
1 change: 1 addition & 0 deletions app/middleware/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = redirect => {
await ctx.redirect('/login');
} else {
const data = ctx.service.user.verify(Token);
// console.log('TOKEN:', data);
if (data.status === 1) {
await next();
} else {
Expand Down

0 comments on commit 32f0f6c

Please sign in to comment.