Skip to content

Commit

Permalink
fix(captcha): add action param
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 2, 2023
1 parent f610e01 commit 05adda7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/GZCTF/ClientApp/src/utils/useCaptcha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export class Turnstile implements Captcha {
return this.challenge
}

public loadTurnstile(siteKey: string, theme: string = 'light') {
public loadTurnstile(siteKey: string, action: string, theme: string = 'light') {
if (!siteKey) return

const script = document.createElement('script')
Expand All @@ -90,13 +90,14 @@ export class Turnstile implements Captcha {
window.turnstile.render('#captcha', {
sitekey: siteKey,
theme: theme,
action: action,
callback: (token: string) => (this.challenge = token),
})
}
}

constructor(siteKey: string, action: string, theme: string = 'light') {
this.loadTurnstile(siteKey, theme)
this.loadTurnstile(siteKey, action, theme)
this.siteKey = siteKey
this.action = action
this.challenge = null
Expand Down

0 comments on commit 05adda7

Please sign in to comment.