Skip to content

Commit

Permalink
Merge pull request #76 from aarne/main
Browse files Browse the repository at this point in the history
fix: Cancel previous authenticate session when new is started
  • Loading branch information
dagnelies authored Sep 23, 2024
2 parents a21f52e + f1d0eb5 commit 4b4e72d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,9 @@ export async function authenticate(options: AuthenticateOptions): Promise<Authen

console.debug(authOptions)

if (options.autocomplete) {
if(ongoingAuth != null)
ongoingAuth.abort('Cancel ongoing authentication')
ongoingAuth = new AbortController();
}
if(ongoingAuth != null)
ongoingAuth.abort('Cancel ongoing authentication')
ongoingAuth = new AbortController();

const raw = await navigator.credentials.get({
publicKey: authOptions,
Expand Down

0 comments on commit 4b4e72d

Please sign in to comment.