@orsetra/shared-auth 1.0.8 → 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 +4 -5
  2. package/package.json +54 -54
@@ -25,15 +25,14 @@ interface SessionProviderProps {
25
25
  * Utilise ZitadelAuthService pour récupérer l'utilisateur
26
26
  */
27
27
  export function SessionProvider({ children, config }: SessionProviderProps) {
28
+ if (!ZitadelAuthService.isConfigured()) {
29
+ ZitadelAuthService.configureAuth(config)
30
+ }
31
+
28
32
  const [user, setUser] = useState<User | null>(null)
29
33
  const [isLoading, setIsLoading] = useState(true)
30
34
 
31
35
  useEffect(() => {
32
- // Configure auth only on client side
33
- if (!ZitadelAuthService.isConfigured()) {
34
- ZitadelAuthService.configureAuth(config)
35
- }
36
-
37
36
  const loadUser = async () => {
38
37
  try {
39
38
  const currentUser = await ZitadelAuthService.getUser()
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@orsetra/shared-auth",
3
- "version": "1.0.8",
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
+ }