Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

refactor(web): migrate webapp email code inputs (#41634)

yyh183741b5f713
diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json
index 8107bf6001a..03c49ef9a02 100644
--- a/oxlint-suppressions.json
+++ b/oxlint-suppressions.json
@@ -83,16 +83,6 @@
"count": 1
}
},
- "web/app/(shareLayout)/webapp-signin/check-code/page.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
- "web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx": {
- "no-restricted-imports": {
- "count": 1
- }
- },
"web/app/(shareLayout)/webapp-signin/normalForm.tsx": {
"jsx-a11y/click-events-have-key-events": {
"count": 2
diff --git a/web/app/(shareLayout)/webapp-signin/check-code/page.tsx b/web/app/(shareLayout)/webapp-signin/check-code/page.tsx
index a44e1c401fd..6a408735326 100644
--- a/web/app/(shareLayout)/webapp-signin/check-code/page.tsx
+++ b/web/app/(shareLayout)/webapp-signin/check-code/page.tsx
@@ -1,12 +1,12 @@
'use client'
import type { FormEvent } from 'react'
import { Button } from '@langgenius/dify-ui/button'
+import { Input } from '@langgenius/dify-ui/input'
import { toast } from '@langgenius/dify-ui/toast'
import { RiArrowLeftLine, RiMailSendFill } from '@remixicon/react'
import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { resolveWebAppLoginRedirect } from '@/app/(shareLayout)/webapp-signin/login-redirect'
-import Input from '@/app/components/base/input'
import Countdown from '@/app/components/signin/countdown'
import { useLocale } from '@/context/i18n'
import { useWebAppStore } from '@/context/web-app-context'
@@ -130,8 +130,12 @@ export default function CheckCode() {
<Input
ref={codeInputRef}
id="code"
+ name="code"
+ inputMode="numeric"
+ autoComplete="one-time-code"
+ spellCheck={false}
value={code}
- onChange={(e) => setCode(e.target.value)}
+ onValueChange={setCode}
maxLength={6}
className="mt-1"
placeholder={t(($) => $['checkCode.verificationCodePlaceholder'], { ns: 'login' }) || ''}
diff --git a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx
index 5bbc39db667..421e1a31c11 100644
--- a/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx
+++ b/web/app/(shareLayout)/webapp-signin/components/mail-and-code-auth.tsx
@@ -1,9 +1,9 @@
import { Button } from '@langgenius/dify-ui/button'
+import { Input } from '@langgenius/dify-ui/input'
import { toast } from '@langgenius/dify-ui/toast'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { resolveWebAppLoginRedirect } from '@/app/(shareLayout)/webapp-signin/login-redirect'
-import Input from '@/app/components/base/input'
import { COUNT_DOWN_TIME_MS, useSetCountdownLeftTime } from '@/app/components/signin/storage'
import { emailRegex } from '@/config'
import { useLocale } from '@/context/i18n'
@@ -82,7 +82,7 @@ export default function MailAndCodeAuth() {
spellCheck={false}
value={email}
placeholder={t(($) => $.emailPlaceholder, { ns: 'login' }) as string}
- onChange={(e) => setEmail(e.target.value)}
+ onValueChange={setEmail}
/>
</div>
<div className="mt-3">