- Notifications
You must be signed in to change notification settings - Fork 20.9k
fix: web app login code encrypt #30705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -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() | ||
| | @@ -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 }) | ||
| ||
| if (ret.result === 'success') { | ||
| setWebAppAccessToken(ret.data.access_token) | ||
| const { access_token } = await fetchAccessToken({ | ||
| | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| | @@ -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 | ||
| | @@ -71,7 +72,7 @@ export default function MailAndPasswordAuth({ isEmailSetup }: MailAndPasswordAut | |
| setIsLoading(true) | ||
| const loginData: Record<string, any> = { | ||
| email, | ||
| password, | ||
| password: encryptPassword(password), | ||
douxc marked this conversation as resolved. Show resolved Hide resolved | ||
| language: locale, | ||
| remember_me: true, | ||
| } | ||
| | ||
Uh oh!
There was an error while loading. Please reload this page.