Skip to content

Commit

Permalink
⚙️ fix(frontend): Fix status code check in axios post
Browse files Browse the repository at this point in the history
Fix the status code check in axios post request to correctly check for 202 status code instead of 204. Also, update the condition for displaying the Cloudflare puzzle in case of loading failure.
  • Loading branch information
sudoskys committed May 13, 2024
1 parent d691d3b commit 37a2072
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ const authSuccess = () => {
axios.post(backendUrl, requestBody)
.then((response) => {
console.log('Response:', response)
if (response.status === 204) {
if (response.status === 202) {
verifyBackendMessage.success = true
verifyBackendMessage.message = 'You are verified'
// 延迟几秒
Expand Down Expand Up @@ -325,6 +325,9 @@ const imageSrc = `https://avatars.githubusercontent.com/u/${user}?s=300&v=4`
<template v-slot:title>
<span class="font-weight-black">Cloudflare Auth</span>
</template>
<v-card-subtitle>
If cloudflare loading failed, please solve the puzzle instead
</v-card-subtitle>
<v-card-text
v-if="isCloudflareFailed.show_turnstile"
>
Expand Down

0 comments on commit 37a2072

Please sign in to comment.