@orsetra/shared-auth 1.0.7 → 1.0.9

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.
Files changed (2) hide show
  1. package/SessionProvider.tsx +5 -7
  2. package/package.json +54 -54
@@ -25,15 +25,13 @@ interface SessionProviderProps {
25
25
  * Utilise ZitadelAuthService pour récupérer l'utilisateur
26
26
  */
27
27
  export function SessionProvider({ children, config }: SessionProviderProps) {
28
- const [user, setUser] = useState<User | null>(null)
29
- const [isLoading, setIsLoading] = useState(true)
30
- const [isConfigured, setIsConfigured] = useState(false)
31
- // Configure auth synchronously before any render
32
28
  if (!ZitadelAuthService.isConfigured()) {
33
- ZitadelAuthService.configureAuth(config)
34
- setIsConfigured(true)
29
+ ZitadelAuthService.configureAuth(config)
35
30
  }
36
31
 
32
+ const [user, setUser] = useState<User | null>(null)
33
+ const [isLoading, setIsLoading] = useState(true)
34
+
37
35
  useEffect(() => {
38
36
  const loadUser = async () => {
39
37
  try {
@@ -50,7 +48,7 @@ export function SessionProvider({ children, config }: SessionProviderProps) {
50
48
  }, [config])
51
49
 
52
50
  const logout = async () => {
53
- if (!isConfigured) return
51
+ if (!ZitadelAuthService.isConfigured()) return
54
52
  await ZitadelAuthService.signOut()
55
53
  setUser(null)
56
54
  }
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@orsetra/shared-auth",
3
- "version": "1.0.7",
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.9",
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
+ }