mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-08-29 01:10:42 +08:00
Update app_2fa_check route to use the one provided by bundle
This commit is contained in:
parent
9911efd62e
commit
31f641c04d
3 changed files with 4 additions and 19 deletions
|
@ -18,3 +18,6 @@ saml_logout:
|
|||
controller: Nbgrp\OneloginSamlBundle\Controller\Logout
|
||||
defaults: { idp: null }
|
||||
methods: ['POST', 'GET']
|
||||
|
||||
app_2fa_check:
|
||||
path: /2fa_check
|
||||
|
|
|
@ -193,7 +193,7 @@ export class AuthService {
|
|||
|
||||
public check2fa(code: string): Observable<any> {
|
||||
|
||||
let route = './profile-auth/2fa/check';
|
||||
let route = './2fa_check';
|
||||
|
||||
route = this.baseRoute.appendNativeAuth(route);
|
||||
route = this.baseRoute.calculateRoute(route);
|
||||
|
|
|
@ -222,24 +222,6 @@ class SecurityController extends AbstractController
|
|||
return new Response(json_encode($response), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
#[Route('/profile-auth/2fa/check', name: 'app_2fa_check', methods: ["GET", "POST"])]
|
||||
public function check2fa(#[CurrentUser] ?User $user, Request $request, TotpAuthenticatorInterface $totpAuthenticator): Response
|
||||
{
|
||||
error_log('inside 2fa check');
|
||||
// request
|
||||
$auth_code = $request->getPayload()->get('auth_code') ?? '';
|
||||
|
||||
$correctCode = $totpAuthenticator->checkCode($user, $auth_code);
|
||||
|
||||
if (!$correctCode){
|
||||
$correctCode = $user->isBackupCode($auth_code);
|
||||
}
|
||||
|
||||
$response = ['two_factor_complete' => $correctCode];
|
||||
|
||||
return new Response(json_encode($response), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
#[Route('/logout', name: 'app_logout', methods: ["GET", "POST"])]
|
||||
public function logout(): void
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue