diff --git a/backend/src/controllers/v3/authController.ts b/backend/src/controllers/v3/authController.ts index ebbcb61b2..413bcefa0 100644 --- a/backend/src/controllers/v3/authController.ts +++ b/backend/src/controllers/v3/authController.ts @@ -47,17 +47,16 @@ export const login1 = async (req: Request, res: Response) => { clientPublicKey: string, providerAuthToken?: string; } = req.body; - + const user = await User.findOne({ email, }).select("+salt +verifier"); if (!user) throw new Error("Failed to find user"); - + if (!user.authMethods.includes(AuthMethod.EMAIL)) { await validateProviderAuthToken({ email, - user, providerAuthToken, }); } @@ -109,7 +108,6 @@ export const login2 = async (req: Request, res: Response) => { if (!user.authMethods.includes(AuthMethod.EMAIL)) { await validateProviderAuthToken({ email, - user, providerAuthToken, }) } diff --git a/backend/src/helpers/auth.ts b/backend/src/helpers/auth.ts index f24c54859..74094cba6 100644 --- a/backend/src/helpers/auth.ts +++ b/backend/src/helpers/auth.ts @@ -392,11 +392,9 @@ export const createToken = ({ export const validateProviderAuthToken = async ({ email, - user, providerAuthToken, }: { email: string; - user: IUser, providerAuthToken?: string; }) => { if (!providerAuthToken) { @@ -407,10 +405,7 @@ export const validateProviderAuthToken = async ({ jwt.verify(providerAuthToken, await getJwtProviderAuthSecret()) ); - if ( - !user.authMethods.includes(decodedToken.authMethod) || - decodedToken.email !== email - ) { + if (decodedToken.email !== email) { throw new Error("Invalid authentication credentials.") } } diff --git a/frontend/src/layouts/AppLayout/AppLayout.tsx b/frontend/src/layouts/AppLayout/AppLayout.tsx index bb08e849d..1391fe298 100644 --- a/frontend/src/layouts/AppLayout/AppLayout.tsx +++ b/frontend/src/layouts/AppLayout/AppLayout.tsx @@ -483,7 +483,7 @@ export const AppLayout = ({ children }: LayoutProps) => { - {/* + { } icon="system-outline-168-view-headline" > - Audit Logs V2 + Audit Logs - */} - + + {/* { Audit Logs - + */} {/* { return (
- {t("common.head-title", { title: t("billing.title") })} + {t("common.head-title", { title: t("settings.project.title") })}