Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
ffeb1b24
authored
Aug 11, 2026
by
Wod
Committed by
GitHub
Aug 11, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): refresh Turnstile token after login attempt (#6764)
Co-authored-by: multica-agent <github@multica.ai>
parent
4eaeefbd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
+10
-1
web/src/features/auth/sign-in/components/user-auth-form.tsx
+10
-1
No files found.
web/src/features/auth/sign-in/components/user-auth-form.tsx
View file @
ffeb1b24
...
@@ -72,6 +72,7 @@ export function UserAuthForm({
...
@@ -72,6 +72,7 @@ export function UserAuthForm({
const
[
isPasskeyLoading
,
setIsPasskeyLoading
]
=
useState
(
false
)
const
[
isPasskeyLoading
,
setIsPasskeyLoading
]
=
useState
(
false
)
const
[
isWeChatDialogOpen
,
setIsWeChatDialogOpen
]
=
useState
(
false
)
const
[
isWeChatDialogOpen
,
setIsWeChatDialogOpen
]
=
useState
(
false
)
const
[
isWeChatSubmitting
,
setIsWeChatSubmitting
]
=
useState
(
false
)
const
[
isWeChatSubmitting
,
setIsWeChatSubmitting
]
=
useState
(
false
)
const
[
turnstileWidgetKey
,
setTurnstileWidgetKey
]
=
useState
(
0
)
const
legalConsentErrorMessage
=
t
(
'Please agree to the legal terms first'
)
const
legalConsentErrorMessage
=
t
(
'Please agree to the legal terms first'
)
const
loginFailedMessage
=
t
(
'Login failed'
)
const
loginFailedMessage
=
t
(
'Login failed'
)
...
@@ -158,12 +159,18 @@ export function UserAuthForm({
...
@@ -158,12 +159,18 @@ export function UserAuthForm({
if
(
!
validateTurnstile
())
return
if
(
!
validateTurnstile
())
return
const
submittedTurnstileToken
=
turnstileToken
if
(
isTurnstileEnabled
)
{
setTurnstileToken
(
''
)
setTurnstileWidgetKey
((
current
)
=>
current
+
1
)
}
setIsLoading
(
true
)
setIsLoading
(
true
)
try
{
try
{
const
res
=
await
login
({
const
res
=
await
login
({
username
:
data
.
username
,
username
:
data
.
username
,
password
:
data
.
password
,
password
:
data
.
password
,
turnstile
:
t
urnstileToken
,
turnstile
:
submittedT
urnstileToken
,
})
})
if
(
res
.
success
)
{
if
(
res
.
success
)
{
...
@@ -408,8 +415,10 @@ export function UserAuthForm({
...
@@ -408,8 +415,10 @@ export function UserAuthForm({
{
isTurnstileEnabled
&&
(
{
isTurnstileEnabled
&&
(
<
div
className=
'mt-2'
>
<
div
className=
'mt-2'
>
<
Turnstile
<
Turnstile
key=
{
turnstileWidgetKey
}
siteKey=
{
turnstileSiteKey
}
siteKey=
{
turnstileSiteKey
}
onVerify=
{
setTurnstileToken
}
onVerify=
{
setTurnstileToken
}
onExpire=
{
()
=>
setTurnstileToken
(
''
)
}
/>
/>
</
div
>
</
div
>
)
}
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment