@orsetra/shared-auth 1.0.10 → 1.0.11
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/components/AuthCallbackError.tsx +58 -0
- package/components/index.ts +2 -0
- package/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
interface AuthCallbackErrorProps {
|
|
4
|
+
error: string
|
|
5
|
+
onRetry: () => void
|
|
6
|
+
onBackToWelcome: () => void
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function AuthCallbackError({ error, onRetry, onBackToWelcome }: AuthCallbackErrorProps) {
|
|
10
|
+
return (
|
|
11
|
+
<>
|
|
12
|
+
<div className="text-6xl mb-6 text-center" style={{ color: 'var(--theme-light-warn-500)' }}>
|
|
13
|
+
⚠️
|
|
14
|
+
</div>
|
|
15
|
+
<h1
|
|
16
|
+
className="text-2xl font-semibold mb-4 text-center"
|
|
17
|
+
style={{ color: 'var(--theme-light-text)' }}
|
|
18
|
+
>
|
|
19
|
+
Échec de l'authentification
|
|
20
|
+
</h1>
|
|
21
|
+
<p
|
|
22
|
+
className="mb-8 leading-relaxed text-center"
|
|
23
|
+
style={{ color: 'var(--theme-light-secondary-text)' }}
|
|
24
|
+
>
|
|
25
|
+
{error}
|
|
26
|
+
</p>
|
|
27
|
+
<div className="space-y-3">
|
|
28
|
+
<button
|
|
29
|
+
onClick={onRetry}
|
|
30
|
+
className="w-full font-medium py-3 px-4 transition-colors"
|
|
31
|
+
style={{
|
|
32
|
+
backgroundColor: 'var(--theme-light-primary-500)',
|
|
33
|
+
color: 'var(--theme-light-primary-contrast-500)',
|
|
34
|
+
borderRadius: '0'
|
|
35
|
+
}}
|
|
36
|
+
onMouseEnter={(e) => (e.currentTarget.style.backgroundColor = 'var(--theme-light-primary-600)')}
|
|
37
|
+
onMouseLeave={(e) => (e.currentTarget.style.backgroundColor = 'var(--theme-light-primary-500)')}
|
|
38
|
+
>
|
|
39
|
+
Réessayer la connexion
|
|
40
|
+
</button>
|
|
41
|
+
<button
|
|
42
|
+
onClick={onBackToWelcome}
|
|
43
|
+
className="w-full font-medium py-3 px-4 transition-colors"
|
|
44
|
+
style={{
|
|
45
|
+
backgroundColor: 'var(--theme-light-background-500)',
|
|
46
|
+
color: 'var(--theme-light-text)',
|
|
47
|
+
borderRadius: '0',
|
|
48
|
+
border: '1px solid var(--theme-light-background-600)'
|
|
49
|
+
}}
|
|
50
|
+
onMouseEnter={(e) => (e.currentTarget.style.backgroundColor = 'var(--theme-light-background-600)')}
|
|
51
|
+
onMouseLeave={(e) => (e.currentTarget.style.backgroundColor = 'var(--theme-light-background-500)')}
|
|
52
|
+
>
|
|
53
|
+
Retour à l'accueil
|
|
54
|
+
</button>
|
|
55
|
+
</div>
|
|
56
|
+
</>
|
|
57
|
+
)
|
|
58
|
+
}
|
package/index.ts
CHANGED
|
@@ -10,5 +10,6 @@ export { SessionProvider, useSession } from './SessionProvider'
|
|
|
10
10
|
|
|
11
11
|
// Components
|
|
12
12
|
export { AuthCard, AuthCardTitle, AuthCardDescription, AuthCardSpinner } from './components/AuthCard'
|
|
13
|
+
export { AuthCallbackError } from './components/AuthCallbackError'
|
|
13
14
|
|
|
14
15
|
export * from './utils'
|