Skip to content

Commit

Permalink
add token after login with OTP
Browse files Browse the repository at this point in the history
  • Loading branch information
Janderson Souza Matias authored and Janderson Souza Matias committed Jan 15, 2024
1 parent 06538ec commit 8486b45
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/modules/auth/controller/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import axios from "axios";
import config from "../../../config";
import { CoachService } from "../../coach/service";
import { UserService } from "../../user/service";
import { LogsService } from "../../logs/service";

export default class AuthenticationController {
public static supertsetLogin = async (
Expand Down Expand Up @@ -84,6 +85,10 @@ export default class AuthenticationController {
const { id, name, role, region } = user;

if (otp) {
await LogsService.create(user, "login");
res.locals.authUser = user;
Authentication.signUser(user, res);

return res.status(200).send({
id,
name,
Expand Down

0 comments on commit 8486b45

Please sign in to comment.