Skip to content

Commit 45ca75f

Browse files
committed
fix: code cleanup
1 parent 6b577c5 commit 45ca75f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

libs/helpers/turnstile-script.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@ export function getTurnstileScript(turnstileSiteKey: string) {
55
if (!window.ui) return;
66
clearInterval(intervalId);
77
8-
const authorized = window.ui.authSelectors.authorized().size > 0;
9-
if (authorized) return;
8+
if (window.ui.authSelectors.authorized().size > 0) return;
109
1110
const container = document.createElement('div');
1211
container.id = 'cf-turnstile';
1312
container.style.position = 'absolute';
1413
container.style.top = '0px';
1514
container.style.right = '0px';
16-
container.style.zIndex = '100000';
1715
container.style.height = '59px';
1816
container.style.display = 'flex';
1917
container.style.alignItems = 'center';
@@ -25,10 +23,9 @@ export function getTurnstileScript(turnstileSiteKey: string) {
2523
sitekey: '${turnstileSiteKey}',
2624
theme: 'dark',
2725
callback: async function(token) {
28-
try {
29-
const authorized = window.ui.authSelectors.authorized().size > 0;
30-
if (authorized) return;
26+
if (window.ui.authSelectors.authorized().size > 0) return;
3127
28+
try {
3229
const res = await fetch('/v1/auth/turnstile', {
3330
method: 'POST',
3431
body: JSON.stringify({ token }),

0 commit comments

Comments
 (0)