Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login ignores userID in Authentication #2

Open
domus71 opened this issue Mar 15, 2024 · 0 comments
Open

Login ignores userID in Authentication #2

domus71 opened this issue Mar 15, 2024 · 0 comments

Comments

@domus71
Copy link

domus71 commented Mar 15, 2024

You must include the user.id in credentialService.getCredentialByCredentialId in handleLoginFinish function.

If you have 2 logins from the same device, you must include the user.id in the database query.

In services/credentialService.ts (line 23)
async getCredentialByCredentialId(credentialId: string, userID: string): Promise<AuthenticatorDevice | null> { try { const [rows] = await promisePool.query( "SELECT * FROM credentials WHERE credential_id = ? AND user_id = ? LIMIT 1", [credentialId, userID] ); ...

In controllers/authentication.ts (line 54)
const dbCredential: AuthenticatorDevice | null = await credentialService.getCredentialByCredentialId( credentialID, loggedInUserId );

Costis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant