@orsetra/shared-auth 1.0.10 → 1.0.12

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.
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { AuthCard, AuthCardTitle, AuthCardDescription, AuthCardSpinner } from './AuthCard'
2
+ export { AuthCallbackError } from './AuthCallbackError'
@@ -31,7 +31,7 @@ export function createAuthConfig(zitadelConfig: ZitadelConfig): UserManagerSetti
31
31
  response_type: zitadelConfig.response_type ?? 'code',
32
32
  scope: zitadelConfig.scope ?? `openid profile email ${
33
33
  zitadelConfig.project_resource_id
34
- ? `urn:zitadel:iam:org:project:id:${zitadelConfig.project_resource_id}:aud urn:zitadel:iam:org:projects:roles`
34
+ ? `urn:zitadel:iam:org:project:id:${zitadelConfig.project_resource_id}:aud urn:zitadel:iam:org:projects:roles access_offline`
35
35
  : ''
36
36
  }`,
37
37
  prompt: zitadelConfig.prompt ?? '',
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'
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@orsetra/shared-auth",
3
- "version": "1.0.10",
4
- "description": "Shared authentication utilities for Orsetra platform using Zitadel",
5
- "main": "./index.ts",
6
- "types": "./index.ts",
7
- "exports": {
8
- ".": "./index.ts",
9
- "./config": "./config/zitadel.config.ts",
10
- "./services": "./services/zitadel.auth.service.ts",
11
- "./components": "./components/index.ts",
12
- "./utils": "./utils/index.ts"
13
- },
14
- "files": [
15
- "index.ts",
16
- "ZitadelProvider.tsx",
17
- "SessionProvider.tsx",
18
- "ProtectedRoute.tsx",
19
- "config",
20
- "services",
21
- "components",
22
- "hooks",
23
- "utils",
24
- "README.md"
25
- ],
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "repository": {
30
- "type": "git",
31
- "url": "https://github.com/orsetra/console-ui.git",
32
- "directory": "packages/shared-auth"
33
- },
34
- "keywords": [
35
- "authentication",
36
- "zitadel",
37
- "oidc",
38
- "oauth2",
39
- "orsetra"
40
- ],
41
- "peerDependencies": {
42
- "react": "^18.0.0 || ^19.0.0",
43
- "react-dom": "^18.0.0 || ^19.0.0",
44
- "next": "^14.0.0 || ^15.0.0"
45
- },
46
- "dependencies": {
47
- "oidc-client-ts": "^3.2.1",
48
- "jose": "^5.9.6"
49
- },
50
- "devDependencies": {
51
- "@types/react": "^19",
52
- "typescript": "^5"
53
- }
54
- }
1
+ {
2
+ "name": "@orsetra/shared-auth",
3
+ "version": "1.0.12",
4
+ "description": "Shared authentication utilities for Orsetra platform using Zitadel",
5
+ "main": "./index.ts",
6
+ "types": "./index.ts",
7
+ "exports": {
8
+ ".": "./index.ts",
9
+ "./config": "./config/zitadel.config.ts",
10
+ "./services": "./services/zitadel.auth.service.ts",
11
+ "./components": "./components/index.ts",
12
+ "./utils": "./utils/index.ts"
13
+ },
14
+ "files": [
15
+ "index.ts",
16
+ "ZitadelProvider.tsx",
17
+ "SessionProvider.tsx",
18
+ "ProtectedRoute.tsx",
19
+ "config",
20
+ "services",
21
+ "components",
22
+ "hooks",
23
+ "utils",
24
+ "README.md"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/orsetra/console-ui.git",
32
+ "directory": "packages/shared-auth"
33
+ },
34
+ "keywords": [
35
+ "authentication",
36
+ "zitadel",
37
+ "oidc",
38
+ "oauth2",
39
+ "orsetra"
40
+ ],
41
+ "peerDependencies": {
42
+ "react": "^18.0.0 || ^19.0.0",
43
+ "react-dom": "^18.0.0 || ^19.0.0",
44
+ "next": "^14.0.0 || ^15.0.0"
45
+ },
46
+ "dependencies": {
47
+ "oidc-client-ts": "^3.2.1",
48
+ "jose": "^5.9.6"
49
+ },
50
+ "devDependencies": {
51
+ "@types/react": "^19",
52
+ "typescript": "^5"
53
+ }
54
+ }