Skip to content

Commit

Permalink
fix bug if otp url label has a question mark
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao Leonardo Pereira committed Jul 21, 2024
1 parent e0361f7 commit dcbbc27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/models/account2FA.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ export class Account2FA implements IAccount2FA {
const pathComponents = url.replace('otpauth://', '')
.split('/')
.filter(e=>!!e)
.map(decodeURIComponent)
.map(e=>e.replace(/\?.*/, ''))
const type = pathComponents[0];
.map(decodeURIComponent)

const type = pathComponents[0];
console.log({url})
if (type !== 'totp') {
throw new Error('Only TOTP is supported');
Expand Down

0 comments on commit dcbbc27

Please sign in to comment.