@allbluecn/web-app 0.24.5 → 0.24.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -16,11 +16,6 @@
|
|
|
16
16
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
import type { ElementType, ReactNode } from 'react'
|
|
19
|
-
import { useNavigate } from '@tanstack/react-router'
|
|
20
|
-
import { ArrowLeft } from 'lucide-react'
|
|
21
|
-
import { Button } from '@/components/ui/button'
|
|
22
|
-
import { isDesktopEdition } from '@/lib/edition-desktop'
|
|
23
|
-
import { m } from '@/paraglide/messages.js'
|
|
24
19
|
import { AnimatedThemeToggler } from '@/components/shared-kit/theme/animated-theme-toggler'
|
|
25
20
|
|
|
26
21
|
interface AuthLayoutProps {
|
|
@@ -30,27 +25,10 @@ interface AuthLayoutProps {
|
|
|
30
25
|
export function AuthLayout({ children }: AuthLayoutProps) {
|
|
31
26
|
const left = findChild(children, AuthLayoutLeft)
|
|
32
27
|
const right = findChild(children, AuthLayoutRight)
|
|
33
|
-
const navigate = useNavigate()
|
|
34
28
|
|
|
35
29
|
return (
|
|
36
30
|
<div className="flex min-h-screen">
|
|
37
31
|
<div className="relative flex flex-1 items-center justify-center p-6">
|
|
38
|
-
{/* 桌面壳:认证页左上角返回(免登录态可随时回到应用)。浏览器/云端不展示——
|
|
39
|
-
redirect 流程中 history.back 会回到需登录页再被弹回登录,形成死循环 */}
|
|
40
|
-
{isDesktopEdition() && (
|
|
41
|
-
<Button
|
|
42
|
-
variant="ghost"
|
|
43
|
-
size="icon"
|
|
44
|
-
className="absolute left-6 top-6 size-8"
|
|
45
|
-
aria-label={m.auth_layout_back()}
|
|
46
|
-
onClick={() => {
|
|
47
|
-
if (window.history.length > 1) window.history.back()
|
|
48
|
-
else void navigate({ to: '/dashboard' })
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
<ArrowLeft className="size-4" />
|
|
52
|
-
</Button>
|
|
53
|
-
)}
|
|
54
32
|
<div className="absolute" style={{ top: '1.5rem', right: '1.5rem' }}>
|
|
55
33
|
<AnimatedThemeToggler className="flex size-6 items-center justify-center rounded-full hover:bg-accent" />
|
|
56
34
|
</div>
|
|
@@ -112,7 +112,7 @@ export const SDK_GROUPS: SdkGroup[] = [
|
|
|
112
112
|
"items": [
|
|
113
113
|
{
|
|
114
114
|
"name": "@allbluecn/web-app",
|
|
115
|
-
"version": "v0.24.
|
|
115
|
+
"version": "v0.24.6",
|
|
116
116
|
"lastUpdate": "Nov 3, 2026",
|
|
117
117
|
"source": "apps/web/package.json",
|
|
118
118
|
"docsUrl": "https://github.com/allbluecn/allblue"
|
|
@@ -16,14 +16,15 @@
|
|
|
16
16
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
18
|
import { useEffect } from 'react'
|
|
19
|
-
import { createLazyFileRoute, Link } from '@tanstack/react-router'
|
|
19
|
+
import { createLazyFileRoute, Link, useNavigate } from '@tanstack/react-router'
|
|
20
20
|
import { toast } from '@/components/ui/toast'
|
|
21
21
|
import { RainbowButton } from '@/components/magicui/rainbow-button'
|
|
22
|
+
import { Button } from '@/components/ui/button'
|
|
22
23
|
import { Checkbox } from '@/components/ui/checkbox'
|
|
23
24
|
import { Field, FieldLabel } from '@/components/ui/field'
|
|
24
25
|
import { Separator } from '@/components/ui/separator'
|
|
25
26
|
import { useAppForm, firstFieldErrorMessage } from '@/components/forms'
|
|
26
|
-
import { ArrowRight, Mail } from 'lucide-react'
|
|
27
|
+
import { ArrowLeft, ArrowRight, Mail } from 'lucide-react'
|
|
27
28
|
import { AuthLayout, AuthLayoutLeft, AuthLayoutRight } from '@/components/auth/auth-layout'
|
|
28
29
|
import { AuthHeader } from '@/components/auth/auth-header'
|
|
29
30
|
import { AuthBrandPanel } from '@/components/auth/auth-brand-panel'
|
|
@@ -36,6 +37,7 @@ import { buildAuthFeatures } from '@/components/auth/auth-features'
|
|
|
36
37
|
import { loginSchema } from '@/routes/_login/schemas/-auth'
|
|
37
38
|
import { m } from "@/paraglide/messages.js";
|
|
38
39
|
import { submitCredentialsLogin } from '@/lib/auth/submit-credentials'
|
|
40
|
+
import { isDesktopEdition } from '@/lib/edition-desktop'
|
|
39
41
|
|
|
40
42
|
export const Route = createLazyFileRoute('/_login/login')({
|
|
41
43
|
component: LoginPage,
|
|
@@ -44,6 +46,7 @@ export const Route = createLazyFileRoute('/_login/login')({
|
|
|
44
46
|
function LoginPage() {
|
|
45
47
|
const { redirect: redirectTo, error: oauthError, ssoToken, ssoError } = Route.useSearch()
|
|
46
48
|
const { googleEnabled } = Route.useLoaderData()
|
|
49
|
+
const navigate = useNavigate()
|
|
47
50
|
|
|
48
51
|
useEffect(() => {
|
|
49
52
|
if (ssoError) {
|
|
@@ -171,8 +174,25 @@ function LoginPage() {
|
|
|
171
174
|
/>
|
|
172
175
|
</form>
|
|
173
176
|
</form.AppForm>
|
|
174
|
-
|
|
175
|
-
|
|
177
|
+
{/* 桌面壳:返回应用(免登录态随时可回),置于「还没有账号?」前。浏览器/
|
|
178
|
+
云端不展示——redirect 流程中 history.back 会回到需登录页再被弹回,死循环 */}
|
|
179
|
+
<div className="flex items-center justify-center gap-1 text-sm">
|
|
180
|
+
{isDesktopEdition() && (
|
|
181
|
+
<Button
|
|
182
|
+
variant="ghost"
|
|
183
|
+
size="sm"
|
|
184
|
+
className="h-7 gap-1 px-2 text-muted-foreground"
|
|
185
|
+
aria-label={m.auth_layout_back()}
|
|
186
|
+
onClick={() => {
|
|
187
|
+
if (window.history.length > 1) window.history.back()
|
|
188
|
+
else void navigate({ to: '/dashboard' })
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<ArrowLeft className="size-3.5" />
|
|
192
|
+
{m.auth_layout_back()}
|
|
193
|
+
</Button>
|
|
194
|
+
)}
|
|
195
|
+
<span>{m.auth_login_noAccount()}</span>
|
|
176
196
|
<Link to="/register" className="font-medium text-primary hover:underline">{m.auth_login_createAccount()}</Link>
|
|
177
197
|
</div>
|
|
178
198
|
</AuthLayoutLeft>
|