@multiplatform.one/keycloak 5.0.27 → 6.0.1
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/dist/cjs/index.cjs +881 -17
- package/dist/esm/index.js +855 -8
- package/package.json +59 -55
- package/src/@types/expo_keycloak_auth.d.ts +4 -0
- package/src/Authenticated.tsx +1 -25
- package/src/Loading.tsx +0 -21
- package/src/authConfig.ts +0 -21
- package/src/betterAuth/client.ts +22 -0
- package/src/betterAuth/expoClient.ts +35 -0
- package/src/betterAuth/index.ts +2 -0
- package/src/hooks/index.ts +0 -21
- package/src/hooks/useAuthConfig.ts +0 -21
- package/src/hooks/useTokensFromQuery/index.native.ts +0 -21
- package/src/hooks/useTokensFromQuery/index.ts +1 -22
- package/src/hooks/useTokensFromState.ts +0 -22
- package/src/index.ts +1 -42
- package/src/keycloak/base.ts +3 -26
- package/src/keycloak/config.ts +7 -23
- package/src/keycloak/context.ts +0 -21
- package/src/keycloak/index.native.ts +1 -22
- package/src/keycloak/index.ts +29 -97
- package/src/keycloak/index.webext.ts +23 -25
- package/src/one.ts +60 -146
- package/src/provider/AfterAuth.tsx +10 -29
- package/src/provider/KeycloakProvider.tsx +2 -23
- package/src/provider/authProvider/index.native.tsx +116 -0
- package/src/provider/{AuthProvider → authProvider}/index.tsx +26 -57
- package/src/provider/{AuthProvider → authProvider}/index.webext.tsx +36 -86
- package/src/provider/{AuthProvider → authProvider}/shared.ts +5 -20
- package/src/provider/index.ts +1 -22
- package/src/session/index.native.ts +8 -20
- package/src/session/index.ts +46 -44
- package/src/session/index.webext.ts +7 -21
- package/src/state.ts +29 -30
- package/src/token.spec.ts +168 -0
- package/src/token.ts +146 -23
- package/src/types.ts +0 -21
- package/dist/cjs/Authenticated.cjs +0 -83
- package/dist/cjs/Authenticated.js +0 -54
- package/dist/cjs/Authenticated.js.map +0 -6
- package/dist/cjs/Authenticated.native.js +0 -73
- package/dist/cjs/Authenticated.native.js.map +0 -6
- package/dist/cjs/Loading.cjs +0 -39
- package/dist/cjs/Loading.js +0 -25
- package/dist/cjs/Loading.js.map +0 -6
- package/dist/cjs/Loading.native.js +0 -32
- package/dist/cjs/Loading.native.js.map +0 -6
- package/dist/cjs/authConfig.cjs +0 -29
- package/dist/cjs/authConfig.js +0 -23
- package/dist/cjs/authConfig.js.map +0 -6
- package/dist/cjs/authConfig.native.js +0 -28
- package/dist/cjs/authConfig.native.js.map +0 -6
- package/dist/cjs/hooks/index.cjs +0 -20
- package/dist/cjs/hooks/index.js +0 -17
- package/dist/cjs/hooks/index.js.map +0 -6
- package/dist/cjs/hooks/index.native.js +0 -24
- package/dist/cjs/hooks/index.native.js.map +0 -6
- package/dist/cjs/hooks/useAuthConfig.cjs +0 -30
- package/dist/cjs/hooks/useAuthConfig.js +0 -24
- package/dist/cjs/hooks/useAuthConfig.js.map +0 -6
- package/dist/cjs/hooks/useAuthConfig.native.js +0 -29
- package/dist/cjs/hooks/useAuthConfig.native.js.map +0 -6
- package/dist/cjs/hooks/useTokensFromQuery/index.cjs +0 -35
- package/dist/cjs/hooks/useTokensFromQuery/index.js +0 -29
- package/dist/cjs/hooks/useTokensFromQuery/index.js.map +0 -6
- package/dist/cjs/hooks/useTokensFromQuery/index.native.js +0 -28
- package/dist/cjs/hooks/useTokensFromQuery/index.native.js.map +0 -6
- package/dist/cjs/hooks/useTokensFromState.cjs +0 -31
- package/dist/cjs/hooks/useTokensFromState.js +0 -26
- package/dist/cjs/hooks/useTokensFromState.js.map +0 -6
- package/dist/cjs/hooks/useTokensFromState.native.js +0 -31
- package/dist/cjs/hooks/useTokensFromState.native.js.map +0 -6
- package/dist/cjs/index.js +0 -21
- package/dist/cjs/index.js.map +0 -6
- package/dist/cjs/index.native.js +0 -32
- package/dist/cjs/index.native.js.map +0 -6
- package/dist/cjs/keycloak/base.cjs +0 -90
- package/dist/cjs/keycloak/base.js +0 -90
- package/dist/cjs/keycloak/base.js.map +0 -6
- package/dist/cjs/keycloak/base.native.js +0 -135
- package/dist/cjs/keycloak/base.native.js.map +0 -6
- package/dist/cjs/keycloak/config.cjs +0 -31
- package/dist/cjs/keycloak/config.js +0 -26
- package/dist/cjs/keycloak/config.js.map +0 -6
- package/dist/cjs/keycloak/config.native.js +0 -30
- package/dist/cjs/keycloak/config.native.js.map +0 -6
- package/dist/cjs/keycloak/context.cjs +0 -27
- package/dist/cjs/keycloak/context.js +0 -22
- package/dist/cjs/keycloak/context.js.map +0 -6
- package/dist/cjs/keycloak/context.native.js +0 -26
- package/dist/cjs/keycloak/context.native.js.map +0 -6
- package/dist/cjs/keycloak/index.cjs +0 -131
- package/dist/cjs/keycloak/index.electron.cjs +0 -54
- package/dist/cjs/keycloak/index.electron.js +0 -40
- package/dist/cjs/keycloak/index.electron.js.map +0 -6
- package/dist/cjs/keycloak/index.electron.native.js +0 -137
- package/dist/cjs/keycloak/index.electron.native.js.map +0 -6
- package/dist/cjs/keycloak/index.js +0 -100
- package/dist/cjs/keycloak/index.js.map +0 -6
- package/dist/cjs/keycloak/index.native.js +0 -100
- package/dist/cjs/keycloak/index.native.js.map +0 -6
- package/dist/cjs/keycloak/index.webext.cjs +0 -54
- package/dist/cjs/keycloak/index.webext.js +0 -40
- package/dist/cjs/keycloak/index.webext.js.map +0 -6
- package/dist/cjs/keycloak/index.webext.native.js +0 -137
- package/dist/cjs/keycloak/index.webext.native.js.map +0 -6
- package/dist/cjs/one.cjs +0 -121
- package/dist/cjs/one.js +0 -119
- package/dist/cjs/one.js.map +0 -6
- package/dist/cjs/one.native.js +0 -125
- package/dist/cjs/one.native.js.map +0 -6
- package/dist/cjs/provider/AfterAuth.cjs +0 -57
- package/dist/cjs/provider/AfterAuth.js +0 -44
- package/dist/cjs/provider/AfterAuth.js.map +0 -6
- package/dist/cjs/provider/AfterAuth.native.js +0 -68
- package/dist/cjs/provider/AfterAuth.native.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.cjs +0 -223
- package/dist/cjs/provider/AuthProvider/index.electron.cjs +0 -223
- package/dist/cjs/provider/AuthProvider/index.electron.js +0 -244
- package/dist/cjs/provider/AuthProvider/index.electron.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.electron.native.js +0 -299
- package/dist/cjs/provider/AuthProvider/index.electron.native.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.js +0 -241
- package/dist/cjs/provider/AuthProvider/index.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.native.js +0 -198
- package/dist/cjs/provider/AuthProvider/index.native.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.webext.cjs +0 -223
- package/dist/cjs/provider/AuthProvider/index.webext.js +0 -244
- package/dist/cjs/provider/AuthProvider/index.webext.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/index.webext.native.js +0 -299
- package/dist/cjs/provider/AuthProvider/index.webext.native.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/shared.cjs +0 -36
- package/dist/cjs/provider/AuthProvider/shared.js +0 -30
- package/dist/cjs/provider/AuthProvider/shared.js.map +0 -6
- package/dist/cjs/provider/AuthProvider/shared.native.js +0 -40
- package/dist/cjs/provider/AuthProvider/shared.native.js.map +0 -6
- package/dist/cjs/provider/KeycloakProvider.cjs +0 -60
- package/dist/cjs/provider/KeycloakProvider.js +0 -50
- package/dist/cjs/provider/KeycloakProvider.js.map +0 -6
- package/dist/cjs/provider/KeycloakProvider.native.js +0 -54
- package/dist/cjs/provider/KeycloakProvider.native.js.map +0 -6
- package/dist/cjs/provider/index.cjs +0 -20
- package/dist/cjs/provider/index.js +0 -17
- package/dist/cjs/provider/index.js.map +0 -6
- package/dist/cjs/provider/index.native.js +0 -24
- package/dist/cjs/provider/index.native.js.map +0 -6
- package/dist/cjs/session/index.cjs +0 -36
- package/dist/cjs/session/index.electron.cjs +0 -32
- package/dist/cjs/session/index.electron.js +0 -27
- package/dist/cjs/session/index.electron.js.map +0 -6
- package/dist/cjs/session/index.electron.native.js +0 -33
- package/dist/cjs/session/index.electron.native.js.map +0 -6
- package/dist/cjs/session/index.js +0 -30
- package/dist/cjs/session/index.js.map +0 -6
- package/dist/cjs/session/index.native.js +0 -33
- package/dist/cjs/session/index.native.js.map +0 -6
- package/dist/cjs/session/index.webext.cjs +0 -32
- package/dist/cjs/session/index.webext.js +0 -27
- package/dist/cjs/session/index.webext.js.map +0 -6
- package/dist/cjs/session/index.webext.native.js +0 -33
- package/dist/cjs/session/index.webext.native.js.map +0 -6
- package/dist/cjs/state.cjs +0 -37
- package/dist/cjs/state.js +0 -31
- package/dist/cjs/state.js.map +0 -6
- package/dist/cjs/state.native.js +0 -46
- package/dist/cjs/state.native.js.map +0 -6
- package/dist/cjs/token.cjs +0 -36
- package/dist/cjs/token.js +0 -30
- package/dist/cjs/token.js.map +0 -6
- package/dist/cjs/token.native.js +0 -36
- package/dist/cjs/token.native.js.map +0 -6
- package/dist/cjs/types.cjs +0 -16
- package/dist/cjs/types.js +0 -14
- package/dist/cjs/types.js.map +0 -6
- package/dist/cjs/types.native.js +0 -15
- package/dist/cjs/types.native.js.map +0 -6
- package/dist/esm/Authenticated.js +0 -36
- package/dist/esm/Authenticated.js.map +0 -6
- package/dist/esm/Authenticated.mjs +0 -48
- package/dist/esm/Authenticated.mjs.map +0 -1
- package/dist/esm/Authenticated.native.js +0 -49
- package/dist/esm/Authenticated.native.js.map +0 -6
- package/dist/esm/Loading.js +0 -11
- package/dist/esm/Loading.js.map +0 -6
- package/dist/esm/Loading.mjs +0 -16
- package/dist/esm/Loading.mjs.map +0 -1
- package/dist/esm/Loading.native.js +0 -13
- package/dist/esm/Loading.native.js.map +0 -6
- package/dist/esm/authConfig.js +0 -7
- package/dist/esm/authConfig.js.map +0 -6
- package/dist/esm/authConfig.mjs +0 -5
- package/dist/esm/authConfig.mjs.map +0 -1
- package/dist/esm/authConfig.native.js +0 -7
- package/dist/esm/authConfig.native.js.map +0 -6
- package/dist/esm/hooks/index.js +0 -4
- package/dist/esm/hooks/index.js.map +0 -6
- package/dist/esm/hooks/index.mjs +0 -4
- package/dist/esm/hooks/index.mjs.map +0 -1
- package/dist/esm/hooks/index.native.js +0 -4
- package/dist/esm/hooks/index.native.js.map +0 -6
- package/dist/esm/hooks/useAuthConfig.js +0 -9
- package/dist/esm/hooks/useAuthConfig.js.map +0 -6
- package/dist/esm/hooks/useAuthConfig.mjs +0 -7
- package/dist/esm/hooks/useAuthConfig.mjs.map +0 -1
- package/dist/esm/hooks/useAuthConfig.native.js +0 -9
- package/dist/esm/hooks/useAuthConfig.native.js.map +0 -6
- package/dist/esm/hooks/useTokensFromQuery/index.js +0 -14
- package/dist/esm/hooks/useTokensFromQuery/index.js.map +0 -6
- package/dist/esm/hooks/useTokensFromQuery/index.mjs +0 -12
- package/dist/esm/hooks/useTokensFromQuery/index.mjs.map +0 -1
- package/dist/esm/hooks/useTokensFromQuery/index.native.js +0 -7
- package/dist/esm/hooks/useTokensFromQuery/index.native.js.map +0 -6
- package/dist/esm/hooks/useTokensFromState.js +0 -11
- package/dist/esm/hooks/useTokensFromState.js.map +0 -6
- package/dist/esm/hooks/useTokensFromState.mjs +0 -8
- package/dist/esm/hooks/useTokensFromState.mjs.map +0 -1
- package/dist/esm/hooks/useTokensFromState.native.js +0 -11
- package/dist/esm/hooks/useTokensFromState.native.js.map +0 -6
- package/dist/esm/index.js.map +0 -6
- package/dist/esm/index.mjs +0 -8
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/index.native.js +0 -8
- package/dist/esm/index.native.js.map +0 -6
- package/dist/esm/keycloak/base.js +0 -77
- package/dist/esm/keycloak/base.js.map +0 -6
- package/dist/esm/keycloak/base.mjs +0 -66
- package/dist/esm/keycloak/base.mjs.map +0 -1
- package/dist/esm/keycloak/base.native.js +0 -116
- package/dist/esm/keycloak/base.native.js.map +0 -6
- package/dist/esm/keycloak/config.js +0 -10
- package/dist/esm/keycloak/config.js.map +0 -6
- package/dist/esm/keycloak/config.mjs +0 -8
- package/dist/esm/keycloak/config.mjs.map +0 -1
- package/dist/esm/keycloak/config.native.js +0 -10
- package/dist/esm/keycloak/config.native.js.map +0 -6
- package/dist/esm/keycloak/context.js +0 -6
- package/dist/esm/keycloak/context.js.map +0 -6
- package/dist/esm/keycloak/context.mjs +0 -4
- package/dist/esm/keycloak/context.mjs.map +0 -1
- package/dist/esm/keycloak/context.native.js +0 -6
- package/dist/esm/keycloak/context.native.js.map +0 -6
- package/dist/esm/keycloak/index.electron.js +0 -30
- package/dist/esm/keycloak/index.electron.js.map +0 -6
- package/dist/esm/keycloak/index.electron.mjs +0 -29
- package/dist/esm/keycloak/index.electron.mjs.map +0 -1
- package/dist/esm/keycloak/index.electron.native.js +0 -117
- package/dist/esm/keycloak/index.electron.native.js.map +0 -6
- package/dist/esm/keycloak/index.js +0 -98
- package/dist/esm/keycloak/index.js.map +0 -6
- package/dist/esm/keycloak/index.mjs +0 -105
- package/dist/esm/keycloak/index.mjs.map +0 -1
- package/dist/esm/keycloak/index.native.js +0 -81
- package/dist/esm/keycloak/index.native.js.map +0 -6
- package/dist/esm/keycloak/index.webext.js +0 -30
- package/dist/esm/keycloak/index.webext.js.map +0 -6
- package/dist/esm/keycloak/index.webext.mjs +0 -29
- package/dist/esm/keycloak/index.webext.mjs.map +0 -1
- package/dist/esm/keycloak/index.webext.native.js +0 -117
- package/dist/esm/keycloak/index.webext.native.js.map +0 -6
- package/dist/esm/one.js +0 -96
- package/dist/esm/one.js.map +0 -6
- package/dist/esm/one.mjs +0 -87
- package/dist/esm/one.mjs.map +0 -1
- package/dist/esm/one.native.js +0 -98
- package/dist/esm/one.native.js.map +0 -6
- package/dist/esm/provider/AfterAuth.js +0 -34
- package/dist/esm/provider/AfterAuth.js.map +0 -6
- package/dist/esm/provider/AfterAuth.mjs +0 -34
- package/dist/esm/provider/AfterAuth.mjs.map +0 -1
- package/dist/esm/provider/AfterAuth.native.js +0 -53
- package/dist/esm/provider/AfterAuth.native.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.electron.js +0 -231
- package/dist/esm/provider/AuthProvider/index.electron.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.electron.mjs +0 -189
- package/dist/esm/provider/AuthProvider/index.electron.mjs.map +0 -1
- package/dist/esm/provider/AuthProvider/index.electron.native.js +0 -281
- package/dist/esm/provider/AuthProvider/index.electron.native.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.js +0 -229
- package/dist/esm/provider/AuthProvider/index.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.mjs +0 -189
- package/dist/esm/provider/AuthProvider/index.mjs.map +0 -1
- package/dist/esm/provider/AuthProvider/index.native.js +0 -186
- package/dist/esm/provider/AuthProvider/index.native.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.webext.js +0 -231
- package/dist/esm/provider/AuthProvider/index.webext.js.map +0 -6
- package/dist/esm/provider/AuthProvider/index.webext.mjs +0 -189
- package/dist/esm/provider/AuthProvider/index.webext.mjs.map +0 -1
- package/dist/esm/provider/AuthProvider/index.webext.native.js +0 -281
- package/dist/esm/provider/AuthProvider/index.webext.native.js.map +0 -6
- package/dist/esm/provider/AuthProvider/shared.js +0 -14
- package/dist/esm/provider/AuthProvider/shared.js.map +0 -6
- package/dist/esm/provider/AuthProvider/shared.mjs +0 -11
- package/dist/esm/provider/AuthProvider/shared.mjs.map +0 -1
- package/dist/esm/provider/AuthProvider/shared.native.js +0 -17
- package/dist/esm/provider/AuthProvider/shared.native.js.map +0 -6
- package/dist/esm/provider/KeycloakProvider.js +0 -37
- package/dist/esm/provider/KeycloakProvider.js.map +0 -6
- package/dist/esm/provider/KeycloakProvider.mjs +0 -37
- package/dist/esm/provider/KeycloakProvider.mjs.map +0 -1
- package/dist/esm/provider/KeycloakProvider.native.js +0 -36
- package/dist/esm/provider/KeycloakProvider.native.js.map +0 -6
- package/dist/esm/provider/index.js +0 -4
- package/dist/esm/provider/index.js.map +0 -6
- package/dist/esm/provider/index.mjs +0 -4
- package/dist/esm/provider/index.mjs.map +0 -1
- package/dist/esm/provider/index.native.js +0 -4
- package/dist/esm/provider/index.native.js.map +0 -6
- package/dist/esm/session/index.electron.js +0 -11
- package/dist/esm/session/index.electron.js.map +0 -6
- package/dist/esm/session/index.electron.mjs +0 -8
- package/dist/esm/session/index.electron.mjs.map +0 -1
- package/dist/esm/session/index.electron.native.js +0 -11
- package/dist/esm/session/index.electron.native.js.map +0 -6
- package/dist/esm/session/index.js +0 -15
- package/dist/esm/session/index.js.map +0 -6
- package/dist/esm/session/index.mjs +0 -13
- package/dist/esm/session/index.mjs.map +0 -1
- package/dist/esm/session/index.native.js +0 -11
- package/dist/esm/session/index.native.js.map +0 -6
- package/dist/esm/session/index.webext.js +0 -11
- package/dist/esm/session/index.webext.js.map +0 -6
- package/dist/esm/session/index.webext.mjs +0 -8
- package/dist/esm/session/index.webext.mjs.map +0 -1
- package/dist/esm/session/index.webext.native.js +0 -11
- package/dist/esm/session/index.webext.native.js.map +0 -6
- package/dist/esm/state.js +0 -16
- package/dist/esm/state.js.map +0 -6
- package/dist/esm/state.mjs +0 -13
- package/dist/esm/state.mjs.map +0 -1
- package/dist/esm/state.native.js +0 -25
- package/dist/esm/state.native.js.map +0 -6
- package/dist/esm/token.js +0 -14
- package/dist/esm/token.js.map +0 -6
- package/dist/esm/token.mjs +0 -12
- package/dist/esm/token.mjs.map +0 -1
- package/dist/esm/token.native.js +0 -14
- package/dist/esm/token.native.js.map +0 -6
- package/dist/esm/types.js +0 -1
- package/dist/esm/types.js.map +0 -6
- package/dist/esm/types.mjs +0 -2
- package/dist/esm/types.mjs.map +0 -1
- package/dist/esm/types.native.js +0 -1
- package/dist/esm/types.native.js.map +0 -6
- package/dist/jsx/Authenticated.js +0 -36
- package/dist/jsx/Authenticated.js.map +0 -6
- package/dist/jsx/Authenticated.mjs +0 -48
- package/dist/jsx/Authenticated.mjs.map +0 -1
- package/dist/jsx/Authenticated.native.js +0 -49
- package/dist/jsx/Authenticated.native.js.map +0 -6
- package/dist/jsx/Loading.js +0 -11
- package/dist/jsx/Loading.js.map +0 -6
- package/dist/jsx/Loading.mjs +0 -16
- package/dist/jsx/Loading.mjs.map +0 -1
- package/dist/jsx/Loading.native.js +0 -13
- package/dist/jsx/Loading.native.js.map +0 -6
- package/dist/jsx/authConfig.js +0 -7
- package/dist/jsx/authConfig.js.map +0 -6
- package/dist/jsx/authConfig.mjs +0 -5
- package/dist/jsx/authConfig.mjs.map +0 -1
- package/dist/jsx/authConfig.native.js +0 -7
- package/dist/jsx/authConfig.native.js.map +0 -6
- package/dist/jsx/hooks/index.js +0 -4
- package/dist/jsx/hooks/index.js.map +0 -6
- package/dist/jsx/hooks/index.mjs +0 -4
- package/dist/jsx/hooks/index.mjs.map +0 -1
- package/dist/jsx/hooks/index.native.js +0 -4
- package/dist/jsx/hooks/index.native.js.map +0 -6
- package/dist/jsx/hooks/useAuthConfig.js +0 -9
- package/dist/jsx/hooks/useAuthConfig.js.map +0 -6
- package/dist/jsx/hooks/useAuthConfig.mjs +0 -7
- package/dist/jsx/hooks/useAuthConfig.mjs.map +0 -1
- package/dist/jsx/hooks/useAuthConfig.native.js +0 -9
- package/dist/jsx/hooks/useAuthConfig.native.js.map +0 -6
- package/dist/jsx/hooks/useTokensFromQuery/index.js +0 -14
- package/dist/jsx/hooks/useTokensFromQuery/index.js.map +0 -6
- package/dist/jsx/hooks/useTokensFromQuery/index.mjs +0 -12
- package/dist/jsx/hooks/useTokensFromQuery/index.mjs.map +0 -1
- package/dist/jsx/hooks/useTokensFromQuery/index.native.js +0 -7
- package/dist/jsx/hooks/useTokensFromQuery/index.native.js.map +0 -6
- package/dist/jsx/hooks/useTokensFromState.js +0 -11
- package/dist/jsx/hooks/useTokensFromState.js.map +0 -6
- package/dist/jsx/hooks/useTokensFromState.mjs +0 -8
- package/dist/jsx/hooks/useTokensFromState.mjs.map +0 -1
- package/dist/jsx/hooks/useTokensFromState.native.js +0 -11
- package/dist/jsx/hooks/useTokensFromState.native.js.map +0 -6
- package/dist/jsx/index.js +0 -8
- package/dist/jsx/index.js.map +0 -6
- package/dist/jsx/index.mjs +0 -8
- package/dist/jsx/index.mjs.map +0 -1
- package/dist/jsx/index.native.js +0 -8
- package/dist/jsx/index.native.js.map +0 -6
- package/dist/jsx/keycloak/base.js +0 -77
- package/dist/jsx/keycloak/base.js.map +0 -6
- package/dist/jsx/keycloak/base.mjs +0 -66
- package/dist/jsx/keycloak/base.mjs.map +0 -1
- package/dist/jsx/keycloak/base.native.js +0 -116
- package/dist/jsx/keycloak/base.native.js.map +0 -6
- package/dist/jsx/keycloak/config.js +0 -10
- package/dist/jsx/keycloak/config.js.map +0 -6
- package/dist/jsx/keycloak/config.mjs +0 -8
- package/dist/jsx/keycloak/config.mjs.map +0 -1
- package/dist/jsx/keycloak/config.native.js +0 -10
- package/dist/jsx/keycloak/config.native.js.map +0 -6
- package/dist/jsx/keycloak/context.js +0 -6
- package/dist/jsx/keycloak/context.js.map +0 -6
- package/dist/jsx/keycloak/context.mjs +0 -4
- package/dist/jsx/keycloak/context.mjs.map +0 -1
- package/dist/jsx/keycloak/context.native.js +0 -6
- package/dist/jsx/keycloak/context.native.js.map +0 -6
- package/dist/jsx/keycloak/index.electron.js +0 -30
- package/dist/jsx/keycloak/index.electron.js.map +0 -6
- package/dist/jsx/keycloak/index.electron.mjs +0 -29
- package/dist/jsx/keycloak/index.electron.mjs.map +0 -1
- package/dist/jsx/keycloak/index.electron.native.js +0 -117
- package/dist/jsx/keycloak/index.electron.native.js.map +0 -6
- package/dist/jsx/keycloak/index.js +0 -98
- package/dist/jsx/keycloak/index.js.map +0 -6
- package/dist/jsx/keycloak/index.mjs +0 -105
- package/dist/jsx/keycloak/index.mjs.map +0 -1
- package/dist/jsx/keycloak/index.native.js +0 -81
- package/dist/jsx/keycloak/index.native.js.map +0 -6
- package/dist/jsx/keycloak/index.webext.js +0 -30
- package/dist/jsx/keycloak/index.webext.js.map +0 -6
- package/dist/jsx/keycloak/index.webext.mjs +0 -29
- package/dist/jsx/keycloak/index.webext.mjs.map +0 -1
- package/dist/jsx/keycloak/index.webext.native.js +0 -117
- package/dist/jsx/keycloak/index.webext.native.js.map +0 -6
- package/dist/jsx/one.js +0 -96
- package/dist/jsx/one.js.map +0 -6
- package/dist/jsx/one.mjs +0 -87
- package/dist/jsx/one.mjs.map +0 -1
- package/dist/jsx/one.native.js +0 -98
- package/dist/jsx/one.native.js.map +0 -6
- package/dist/jsx/provider/AfterAuth.js +0 -34
- package/dist/jsx/provider/AfterAuth.js.map +0 -6
- package/dist/jsx/provider/AfterAuth.mjs +0 -34
- package/dist/jsx/provider/AfterAuth.mjs.map +0 -1
- package/dist/jsx/provider/AfterAuth.native.js +0 -53
- package/dist/jsx/provider/AfterAuth.native.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.electron.js +0 -231
- package/dist/jsx/provider/AuthProvider/index.electron.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.electron.mjs +0 -189
- package/dist/jsx/provider/AuthProvider/index.electron.mjs.map +0 -1
- package/dist/jsx/provider/AuthProvider/index.electron.native.js +0 -281
- package/dist/jsx/provider/AuthProvider/index.electron.native.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.js +0 -229
- package/dist/jsx/provider/AuthProvider/index.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.mjs +0 -189
- package/dist/jsx/provider/AuthProvider/index.mjs.map +0 -1
- package/dist/jsx/provider/AuthProvider/index.native.js +0 -186
- package/dist/jsx/provider/AuthProvider/index.native.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.webext.js +0 -231
- package/dist/jsx/provider/AuthProvider/index.webext.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/index.webext.mjs +0 -189
- package/dist/jsx/provider/AuthProvider/index.webext.mjs.map +0 -1
- package/dist/jsx/provider/AuthProvider/index.webext.native.js +0 -281
- package/dist/jsx/provider/AuthProvider/index.webext.native.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/shared.js +0 -14
- package/dist/jsx/provider/AuthProvider/shared.js.map +0 -6
- package/dist/jsx/provider/AuthProvider/shared.mjs +0 -11
- package/dist/jsx/provider/AuthProvider/shared.mjs.map +0 -1
- package/dist/jsx/provider/AuthProvider/shared.native.js +0 -17
- package/dist/jsx/provider/AuthProvider/shared.native.js.map +0 -6
- package/dist/jsx/provider/KeycloakProvider.js +0 -37
- package/dist/jsx/provider/KeycloakProvider.js.map +0 -6
- package/dist/jsx/provider/KeycloakProvider.mjs +0 -37
- package/dist/jsx/provider/KeycloakProvider.mjs.map +0 -1
- package/dist/jsx/provider/KeycloakProvider.native.js +0 -36
- package/dist/jsx/provider/KeycloakProvider.native.js.map +0 -6
- package/dist/jsx/provider/index.js +0 -4
- package/dist/jsx/provider/index.js.map +0 -6
- package/dist/jsx/provider/index.mjs +0 -4
- package/dist/jsx/provider/index.mjs.map +0 -1
- package/dist/jsx/provider/index.native.js +0 -4
- package/dist/jsx/provider/index.native.js.map +0 -6
- package/dist/jsx/session/index.electron.js +0 -11
- package/dist/jsx/session/index.electron.js.map +0 -6
- package/dist/jsx/session/index.electron.mjs +0 -8
- package/dist/jsx/session/index.electron.mjs.map +0 -1
- package/dist/jsx/session/index.electron.native.js +0 -11
- package/dist/jsx/session/index.electron.native.js.map +0 -6
- package/dist/jsx/session/index.js +0 -15
- package/dist/jsx/session/index.js.map +0 -6
- package/dist/jsx/session/index.mjs +0 -13
- package/dist/jsx/session/index.mjs.map +0 -1
- package/dist/jsx/session/index.native.js +0 -11
- package/dist/jsx/session/index.native.js.map +0 -6
- package/dist/jsx/session/index.webext.js +0 -11
- package/dist/jsx/session/index.webext.js.map +0 -6
- package/dist/jsx/session/index.webext.mjs +0 -8
- package/dist/jsx/session/index.webext.mjs.map +0 -1
- package/dist/jsx/session/index.webext.native.js +0 -11
- package/dist/jsx/session/index.webext.native.js.map +0 -6
- package/dist/jsx/state.js +0 -16
- package/dist/jsx/state.js.map +0 -6
- package/dist/jsx/state.mjs +0 -13
- package/dist/jsx/state.mjs.map +0 -1
- package/dist/jsx/state.native.js +0 -25
- package/dist/jsx/state.native.js.map +0 -6
- package/dist/jsx/token.js +0 -14
- package/dist/jsx/token.js.map +0 -6
- package/dist/jsx/token.mjs +0 -12
- package/dist/jsx/token.mjs.map +0 -1
- package/dist/jsx/token.native.js +0 -14
- package/dist/jsx/token.native.js.map +0 -6
- package/dist/jsx/types.js +0 -1
- package/dist/jsx/types.js.map +0 -6
- package/dist/jsx/types.mjs +0 -2
- package/dist/jsx/types.mjs.map +0 -1
- package/dist/jsx/types.native.js +0 -1
- package/dist/jsx/types.native.js.map +0 -6
- package/src/@types/expoKeycloakAuth.d.ts +0 -25
- package/src/keycloak/index.electron.ts +0 -72
- package/src/provider/AuthProvider/index.electron.tsx +0 -419
- package/src/provider/AuthProvider/index.native.tsx +0 -308
- package/src/session/index.electron.ts +0 -33
- package/types/Authenticated.d.ts +0 -29
- package/types/Authenticated.d.ts.map +0 -1
- package/types/Loading.d.ts +0 -26
- package/types/Loading.d.ts.map +0 -1
- package/types/authConfig.d.ts +0 -11
- package/types/authConfig.d.ts.map +0 -1
- package/types/hooks/index.d.ts +0 -24
- package/types/hooks/index.d.ts.map +0 -1
- package/types/hooks/useAuthConfig.d.ts +0 -2
- package/types/hooks/useAuthConfig.d.ts.map +0 -1
- package/types/hooks/useTokensFromQuery/index.d.ts +0 -2
- package/types/hooks/useTokensFromQuery/index.d.ts.map +0 -1
- package/types/hooks/useTokensFromQuery/index.native.d.ts +0 -2
- package/types/hooks/useTokensFromQuery/index.native.d.ts.map +0 -1
- package/types/hooks/useTokensFromState.d.ts +0 -2
- package/types/hooks/useTokensFromState.d.ts.map +0 -1
- package/types/index.d.ts +0 -28
- package/types/index.d.ts.map +0 -1
- package/types/keycloak/base.d.ts +0 -51
- package/types/keycloak/base.d.ts.map +0 -1
- package/types/keycloak/config.d.ts +0 -8
- package/types/keycloak/config.d.ts.map +0 -1
- package/types/keycloak/context.d.ts +0 -4
- package/types/keycloak/context.d.ts.map +0 -1
- package/types/keycloak/index.d.ts +0 -15
- package/types/keycloak/index.d.ts.map +0 -1
- package/types/keycloak/index.electron.d.ts +0 -12
- package/types/keycloak/index.electron.d.ts.map +0 -1
- package/types/keycloak/index.native.d.ts +0 -27
- package/types/keycloak/index.native.d.ts.map +0 -1
- package/types/keycloak/index.webext.d.ts +0 -12
- package/types/keycloak/index.webext.d.ts.map +0 -1
- package/types/one.d.ts +0 -27
- package/types/one.d.ts.map +0 -1
- package/types/provider/AfterAuth.d.ts +0 -26
- package/types/provider/AfterAuth.d.ts.map +0 -1
- package/types/provider/AuthProvider/index.d.ts +0 -23
- package/types/provider/AuthProvider/index.d.ts.map +0 -1
- package/types/provider/AuthProvider/index.electron.d.ts +0 -23
- package/types/provider/AuthProvider/index.electron.d.ts.map +0 -1
- package/types/provider/AuthProvider/index.native.d.ts +0 -23
- package/types/provider/AuthProvider/index.native.d.ts.map +0 -1
- package/types/provider/AuthProvider/index.webext.d.ts +0 -23
- package/types/provider/AuthProvider/index.webext.d.ts.map +0 -1
- package/types/provider/AuthProvider/shared.d.ts +0 -53
- package/types/provider/AuthProvider/shared.d.ts.map +0 -1
- package/types/provider/KeycloakProvider.d.ts +0 -30
- package/types/provider/KeycloakProvider.d.ts.map +0 -1
- package/types/provider/index.d.ts +0 -24
- package/types/provider/index.d.ts.map +0 -1
- package/types/session/index.d.ts +0 -16
- package/types/session/index.d.ts.map +0 -1
- package/types/session/index.electron.d.ts +0 -5
- package/types/session/index.electron.d.ts.map +0 -1
- package/types/session/index.native.d.ts +0 -5
- package/types/session/index.native.d.ts.map +0 -1
- package/types/session/index.webext.d.ts +0 -5
- package/types/session/index.webext.d.ts.map +0 -1
- package/types/state.d.ts +0 -9
- package/types/state.d.ts.map +0 -1
- package/types/token.d.ts +0 -16
- package/types/token.d.ts.map +0 -1
- package/types/types.d.ts +0 -19
- package/types/types.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,32 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/keycloak",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "keycloak client for multiplatform.one ecosystem",
|
|
5
|
-
"main": "dist/cjs",
|
|
6
|
-
"module": "dist/esm",
|
|
7
|
-
"module:jsx": "dist/jsx",
|
|
8
|
-
"source": "src/index.ts",
|
|
9
|
-
"types": "types/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./types/index.d.ts",
|
|
13
|
-
"import": "./dist/esm/index.js",
|
|
14
|
-
"require": "./dist/cjs/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./one": {
|
|
17
|
-
"types": "./types/one.d.ts",
|
|
18
|
-
"import": "./dist/esm/one.js",
|
|
19
|
-
"require": "./dist/cjs/one.js"
|
|
20
|
-
},
|
|
21
|
-
"./emptyNextAuthReact": {
|
|
22
|
-
"types": "./types/emptyNextAuthReact.d.ts",
|
|
23
|
-
"import": "./dist/esm/emptyNextAuthReact.js",
|
|
24
|
-
"require": "./dist/cjs/emptyNextAuthReact.js"
|
|
25
|
-
},
|
|
26
|
-
"./package.json": "./package.json"
|
|
27
|
-
},
|
|
28
|
-
"author": "BitSpur",
|
|
29
|
-
"sideEffects": false,
|
|
30
5
|
"keywords": [
|
|
31
6
|
"auth",
|
|
32
7
|
"keycloak",
|
|
@@ -36,52 +11,81 @@
|
|
|
36
11
|
],
|
|
37
12
|
"homepage": "https://multiplatform.one",
|
|
38
13
|
"license": "Apache-2.0",
|
|
14
|
+
"author": "BitSpur",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://gitlab.com/risserlabs/multiplatform.one/keycloak"
|
|
18
|
+
},
|
|
19
|
+
"source": "src/index.ts",
|
|
39
20
|
"files": [
|
|
40
21
|
"dist",
|
|
41
22
|
"routes",
|
|
42
23
|
"src",
|
|
43
24
|
"types"
|
|
44
25
|
],
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"main": "src/index.ts",
|
|
28
|
+
"module": "src/index.ts",
|
|
29
|
+
"types": "src/index.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
"./package.json": "./package.json",
|
|
32
|
+
".": {
|
|
33
|
+
"react-native": "./src/index.native.ts",
|
|
34
|
+
"types": "./src/index.ts",
|
|
35
|
+
"import": "./src/index.ts",
|
|
36
|
+
"require": "./src/index.ts",
|
|
37
|
+
"default": "./src/index.ts"
|
|
38
|
+
},
|
|
39
|
+
"./one": {
|
|
40
|
+
"types": "./src/one.ts",
|
|
41
|
+
"import": "./src/one.ts",
|
|
42
|
+
"require": "./src/one.ts"
|
|
43
|
+
}
|
|
48
44
|
},
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@better-auth/expo": "^1.6.9",
|
|
50
|
+
"better-auth": "^1.6.9",
|
|
51
|
+
"jwt-decode": "^4.0.0",
|
|
52
|
+
"@multiplatform.one/keycloak-js": "6.0.1",
|
|
53
|
+
"@multiplatform.one/store": "6.0.1"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
|
-
"@
|
|
56
|
-
"@
|
|
57
|
-
"@testing-library/
|
|
58
|
-
"@testing-library/react": "^15.0.7",
|
|
56
|
+
"@tamagui/build": "2.0.0-rc.41",
|
|
57
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
58
|
+
"@testing-library/react": "^16.3.2",
|
|
59
59
|
"@types/lodash.camelcase": "^4.3.9",
|
|
60
60
|
"@types/lodash.startcase": "^4.4.9",
|
|
61
|
-
"@types/react": "
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"react": "
|
|
66
|
-
"typescript": "~5.
|
|
67
|
-
"vitest": "^1.
|
|
61
|
+
"@types/react": "~19.2.14",
|
|
62
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
63
|
+
"esbuild": "^0.28.0",
|
|
64
|
+
"one": "^1.16.5",
|
|
65
|
+
"react": "19.2.5",
|
|
66
|
+
"typescript": "~5.9.3",
|
|
67
|
+
"vitest": "^4.1.5",
|
|
68
|
+
"@multiplatform.one/config": "6.0.1",
|
|
69
|
+
"@multiplatform.one/logger": "6.0.1",
|
|
70
|
+
"@multiplatform.one/platform": "6.0.1",
|
|
71
|
+
"@multiplatform.one/test-utils": "6.0.1"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"react": "^19.1.0",
|
|
75
|
+
"@multiplatform.one/logger": "6.0.1",
|
|
76
|
+
"@multiplatform.one/platform": "6.0.1"
|
|
77
|
+
},
|
|
78
|
+
"optionalDependencies": {
|
|
79
|
+
"expo-secure-store": "^55.0.13",
|
|
80
|
+
"expo-web-browser": "^55.0.14"
|
|
68
81
|
},
|
|
69
82
|
"engines": {
|
|
70
83
|
"node": ">=6.0.0"
|
|
71
84
|
},
|
|
72
|
-
"
|
|
73
|
-
"@auth/core": "^0.36.0",
|
|
74
|
-
"@multiplatform.one/authjs": "5.0.27",
|
|
75
|
-
"@multiplatform.one/use-store": "5.0.27",
|
|
76
|
-
"expo-auth-session": "^5.5.2",
|
|
77
|
-
"expo-crypto": "^13.0.2",
|
|
78
|
-
"jwt-decode": "^4.0.0",
|
|
79
|
-
"keycloak-js": "^24.0.5",
|
|
80
|
-
"next-auth": "^4.24.11"
|
|
81
|
-
},
|
|
85
|
+
"module:jsx": "dist/jsx",
|
|
82
86
|
"scripts": {
|
|
83
87
|
"typecheck": "tsc --noEmit",
|
|
84
|
-
"build": "rm -rf dist types 2>/dev/null &&
|
|
88
|
+
"build": "rm -rf dist types 2>/dev/null && node scripts/build.mjs",
|
|
85
89
|
"test": "vitest run --coverage --coverage.provider=v8 --coverage.reporter=text --coverage.reporter=lcov --coverage.reporter=html"
|
|
86
90
|
}
|
|
87
91
|
}
|
package/src/Authenticated.tsx
CHANGED
|
@@ -1,33 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
* File: /src/Authenticated.tsx
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 19-11-2024 20:26:31
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
23
|
-
import { isIframe, isServer } from "multiplatform.one";
|
|
1
|
+
import { isIframe, isServer } from "@multiplatform.one/platform";
|
|
24
2
|
import { type ComponentType, type PropsWithChildren, useEffect } from "react";
|
|
25
3
|
import { Text } from "tamagui";
|
|
26
4
|
import { useAuthConfig, useTokensFromQuery } from "./hooks";
|
|
27
5
|
import { useKeycloak } from "./keycloak/index";
|
|
28
6
|
|
|
29
|
-
global.AsyncStorage = AsyncStorage;
|
|
30
|
-
|
|
31
7
|
export interface AuthenticatedProps extends PropsWithChildren {
|
|
32
8
|
disabled?: boolean;
|
|
33
9
|
loadingComponent?: ComponentType;
|
package/src/Loading.tsx
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/Loading.tsx
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 01-01-1970 00:00:00
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import type { ComponentType } from "react";
|
|
23
2
|
import { Text } from "tamagui";
|
|
24
3
|
import { useAuthConfig } from "./hooks";
|
package/src/authConfig.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/authConfig.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 04-04-2024 15:50:39
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import { createContext } from "react";
|
|
23
2
|
|
|
24
3
|
export const defaultAuthConfig: AuthConfig = {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Auth React client instance for web.
|
|
3
|
+
* Used by AuthProvider and useKeycloak on web platform.
|
|
4
|
+
* Base URL is set at runtime via KeycloakProvider props (or defaults to same origin).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { createAuthClient } from "better-auth/react";
|
|
8
|
+
import { genericOAuthClient } from "better-auth/client/plugins";
|
|
9
|
+
import { isWeb } from "@multiplatform.one/platform";
|
|
10
|
+
|
|
11
|
+
let _client: ReturnType<typeof createAuthClient> | undefined;
|
|
12
|
+
|
|
13
|
+
export function getAuthClient(baseURL?: string) {
|
|
14
|
+
if (_client) return _client;
|
|
15
|
+
_client = createAuthClient({
|
|
16
|
+
baseURL: baseURL || (isWeb && typeof window !== "undefined" ? window.location.origin : ""),
|
|
17
|
+
plugins: [genericOAuthClient()],
|
|
18
|
+
});
|
|
19
|
+
return _client;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type AuthClient = ReturnType<typeof getAuthClient>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Better Auth Expo client for native (React Native / Expo).
|
|
3
|
+
* Uses @better-auth/expo/client (expoClient plugin) and SecureStore.
|
|
4
|
+
* Wraps signIn.social for Keycloak; same session/useSession API.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { createAuthClient } from "better-auth/react";
|
|
8
|
+
import { genericOAuthClient } from "better-auth/client/plugins";
|
|
9
|
+
import { expoClient } from "@better-auth/expo/client";
|
|
10
|
+
import * as SecureStore from "expo-secure-store";
|
|
11
|
+
|
|
12
|
+
let _client: ReturnType<typeof createAuthClient> | undefined;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create or return the singleton Better Auth Expo client.
|
|
16
|
+
* @param baseURL — Better Auth server base URL (e.g. https://app.example.com)
|
|
17
|
+
* @param scheme — Expo deep link scheme (from app.json, e.g. "one" or "myapp")
|
|
18
|
+
*/
|
|
19
|
+
export function getExpoAuthClient(baseURL: string, scheme = "one") {
|
|
20
|
+
if (_client) return _client;
|
|
21
|
+
_client = createAuthClient({
|
|
22
|
+
baseURL,
|
|
23
|
+
plugins: [
|
|
24
|
+
genericOAuthClient(),
|
|
25
|
+
expoClient({
|
|
26
|
+
scheme,
|
|
27
|
+
storagePrefix: "better-auth",
|
|
28
|
+
storage: SecureStore,
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
return _client;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ExpoAuthClient = ReturnType<typeof getExpoAuthClient>;
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/index.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 19-11-2024 20:26:31
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
export * from "./useAuthConfig";
|
|
23
2
|
export * from "./useTokensFromQuery/index";
|
|
24
3
|
export * from "./useTokensFromState";
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/hooks/useAuthConfig.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 04-04-2024 15:50:39
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import { useContext } from "react";
|
|
23
2
|
import { AuthConfigContext } from "../authConfig";
|
|
24
3
|
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/hooks/useTokensFromQuery/index.native.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 04-04-2024 15:50:39
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
export const useTokensFromQuery = () => false;
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* File: /src/hooks/useTokensFromQuery/index.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 19-11-2024 20:26:31
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { isIframe } from "multiplatform.one";
|
|
1
|
+
import { isIframe } from "@multiplatform.one/platform";
|
|
23
2
|
import { useAuthConfig } from "../useAuthConfig";
|
|
24
3
|
|
|
25
4
|
export function useTokensFromQuery() {
|
|
@@ -1,29 +1,7 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/hooks/useTokensFromState.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 04-04-2024 15:50:39
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import { useAuthStore } from "../state";
|
|
23
2
|
import { validOrRefreshableToken } from "../token";
|
|
24
3
|
|
|
25
4
|
export function useTokensFromStore() {
|
|
26
5
|
const authStore = useAuthStore();
|
|
27
|
-
if (typeof authStore === "undefined") return undefined;
|
|
28
6
|
return !!validOrRefreshableToken(authStore.token, authStore.refreshToken);
|
|
29
7
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,49 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/index.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 10-01-2025 21:02:36
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2025
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* File: /src/index.ts
|
|
24
|
-
* Project: @multiplatform.one/keycloak
|
|
25
|
-
* File Created: 19-11-2024 20:26:31
|
|
26
|
-
* Author: Clay Risser
|
|
27
|
-
* -----
|
|
28
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
29
|
-
*
|
|
30
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
31
|
-
* you may not use this file except in compliance with the License.
|
|
32
|
-
* You may obtain a copy of the License at
|
|
33
|
-
*
|
|
34
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
35
|
-
*
|
|
36
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
37
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
38
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
39
|
-
* See the License for the specific language governing permissions and
|
|
40
|
-
* limitations under the License.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
1
|
export * from "./Authenticated";
|
|
44
2
|
export * from "./authConfig";
|
|
45
3
|
export * from "./hooks/index";
|
|
46
4
|
export * from "./keycloak/index";
|
|
47
5
|
export * from "./provider/index";
|
|
48
6
|
export * from "./session/index";
|
|
7
|
+
export * from "./token";
|
|
49
8
|
export * from "./types";
|
package/src/keycloak/base.ts
CHANGED
|
@@ -1,31 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/keycloak/base.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 25-12-2024 04:55:48
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import type { AuthRequestPromptOptions } from "expo-auth-session";
|
|
23
1
|
import { jwtDecode } from "jwt-decode";
|
|
24
|
-
import type KeycloakClient from "keycloak-js";
|
|
2
|
+
import type KeycloakClient from "@multiplatform.one/keycloak-js";
|
|
25
3
|
import type {
|
|
26
4
|
KeycloakLoginOptions as KeycloakJsLoginOptions,
|
|
27
5
|
KeycloakLogoutOptions as KeycloakJsLogoutOptions,
|
|
28
|
-
} from "keycloak-js";
|
|
6
|
+
} from "@multiplatform.one/keycloak-js";
|
|
29
7
|
import { useContext } from "react";
|
|
30
8
|
import { useAuthConfig } from "../hooks/index";
|
|
31
9
|
import type { Session } from "../session/index";
|
|
@@ -199,8 +177,7 @@ export function useKeycloak() {
|
|
|
199
177
|
}
|
|
200
178
|
|
|
201
179
|
export type KeycloakLogoutOptions = KeycloakJsLogoutOptions;
|
|
202
|
-
export type KeycloakLoginOptions = KeycloakJsLoginOptions &
|
|
203
|
-
AuthRequestPromptOptions & { redirect?: boolean };
|
|
180
|
+
export type KeycloakLoginOptions = KeycloakJsLoginOptions & { redirect?: boolean };
|
|
204
181
|
|
|
205
182
|
export interface ResourceAccess {
|
|
206
183
|
[clientId: string]: {
|
package/src/keycloak/config.ts
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
* File: /src/keycloak/config.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 27-04-2024 10:53:19
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import type { KeycloakConfig as KeycloakJsConfig } from "keycloak-js";
|
|
1
|
+
import type { KeycloakServerConfig } from "@multiplatform.one/keycloak-js";
|
|
23
2
|
import { createContext } from "react";
|
|
24
3
|
|
|
25
|
-
|
|
4
|
+
/** App config uses the Keycloak-server shape ({ url, realm, clientId }), not generic OIDC. */
|
|
5
|
+
export interface KeycloakConfig extends KeycloakServerConfig {
|
|
26
6
|
publicClientId?: string;
|
|
27
7
|
scopes?: string[];
|
|
8
|
+
/** Better Auth server base URL (for native/Expo). Defaults to same origin on web. */
|
|
9
|
+
betterAuthBaseUrl?: string;
|
|
10
|
+
/** Expo deep-link scheme (e.g. "multiplatform-one"). Used by @better-auth/expo client. */
|
|
11
|
+
expoScheme?: string;
|
|
28
12
|
}
|
|
29
13
|
|
|
30
14
|
export const KeycloakConfigContext = createContext<KeycloakConfig>({
|
package/src/keycloak/context.ts
CHANGED
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* File: /src/keycloak/context.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 04-04-2024 15:50:39
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
1
|
import { createContext } from "react";
|
|
23
2
|
import type { Keycloak } from ".";
|
|
24
3
|
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* File: /src/keycloak/index.native.ts
|
|
3
|
-
* Project: @multiplatform.one/keycloak
|
|
4
|
-
* File Created: 19-11-2024 20:26:31
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* BitSpur (c) Copyright 2021 - 2024
|
|
8
|
-
*
|
|
9
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
|
-
* you may not use this file except in compliance with the License.
|
|
11
|
-
* You may obtain a copy of the License at
|
|
12
|
-
*
|
|
13
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
-
*
|
|
15
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
16
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
17
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
18
|
-
* See the License for the specific language governing permissions and
|
|
19
|
-
* limitations under the License.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { isStorybook } from "multiplatform.one";
|
|
1
|
+
import { isStorybook } from "@multiplatform.one/platform";
|
|
23
2
|
import { useContext } from "react";
|
|
24
3
|
import { useAuthConfig } from "../hooks";
|
|
25
4
|
import { BaseKeycloak } from "./base";
|