Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/app/(shareLayout)/webapp-signin/check-code/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import Button from '@/app/components/base/button'
import Input from '@/app/components/base/input'
import Toast from '@/app/components/base/toast'
import Countdown from '@/app/components/signin/countdown'

import { useLocale } from '@/context/i18n'
import { useWebAppStore } from '@/context/web-app-context'
import { sendWebAppEMailLoginCode, webAppEmailLoginWithCode } from '@/service/common'
import { fetchAccessToken } from '@/service/share'
import { setWebAppAccessToken, setWebAppPassport } from '@/service/webapp-auth'
import { encryptVerificationCode } from '@/utils/encryption'

export default function CheckCode() {
const { t } = useTranslation()
Expand Down Expand Up @@ -64,7 +64,7 @@ export default function CheckCode() {
return
}
setIsLoading(true)
const ret = await webAppEmailLoginWithCode({ email, code, token })
const ret = await webAppEmailLoginWithCode({ email, code: encryptVerificationCode(code), token })
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks email code login functionality. The frontend now encrypts the verification code using Base64 encoding, but the backend web app email code login endpoint at /email-code-login/validity (in api/controllers/web/login.py) does not have the @decrypt_code_field decorator to decrypt it. The console email code login endpoint uses this decorator, but it's missing for web app login. This will cause all email code login attempts to fail because the backend will compare the Base64-encoded string against the actual code.

Copilot uses AI. Check for mistakes.
if (ret.result === 'success') {
setWebAppAccessToken(ret.data.access_token)
const { access_token } = await fetchAccessToken({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useWebAppStore } from '@/context/web-app-context'
import { webAppLogin } from '@/service/common'
import { fetchAccessToken } from '@/service/share'
import { setWebAppAccessToken, setWebAppPassport } from '@/service/webapp-auth'
import { encryptPassword } from '@/utils/encryption'

type MailAndPasswordAuthProps = {
isEmailSetup: boolean
Expand Down Expand Up @@ -71,7 +72,7 @@ export default function MailAndPasswordAuth({ isEmailSetup }: MailAndPasswordAut
setIsLoading(true)
const loginData: Record<string, any> = {
email,
password,
password: encryptPassword(password),
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change breaks web app login functionality. The frontend now encrypts the password using Base64 encoding, but the backend web app login endpoint at /login (in api/controllers/web/login.py) does not have the @decrypt_password_field decorator to decrypt it. The console login endpoint uses this decorator, but it's missing for web app login. This will cause all web app login attempts to fail because the backend will try to authenticate using the Base64-encoded string instead of the actual password.

Copilot uses AI. Check for mistakes.
language: locale,
remember_me: true,
}
Expand Down
Loading