@pofsis-nbt/pofsis-auth 0.1.0 → 1.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/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import type { ComponentType, ReactNode } from 'react';
2
1
  export interface PofsisUser {
3
2
  id: string;
4
3
  accountId?: string;
@@ -40,6 +39,16 @@ export interface PofsisAuthConfig {
40
39
  authUrl: string;
41
40
  scope: string;
42
41
  }
42
+ export type AuthLoadingScreenProps = {
43
+ callback?: boolean;
44
+ };
45
+ export type AuthErrorScreenProps = {
46
+ retryHref?: string;
47
+ };
48
+ export type AuthComponentOverrides = {
49
+ LoadingScreen?: import('react').ComponentType<AuthLoadingScreenProps>;
50
+ ErrorScreen?: import('react').ComponentType<AuthErrorScreenProps>;
51
+ };
43
52
  export type AuthScreen = 'login' | 'signup' | 'reset';
44
53
  export type AuthMethod = 'password' | 'passkey' | 'otp';
45
54
  export type AuthLaunchOptions = {
@@ -49,16 +58,6 @@ export type AuthLaunchOptions = {
49
58
  loginHint?: string;
50
59
  method?: AuthMethod;
51
60
  };
52
- export type AuthLoadingScreenProps = {
53
- callback?: boolean;
54
- };
55
- export type AuthErrorScreenProps = {
56
- retryHref?: string;
57
- };
58
- export type AuthComponentOverrides = {
59
- LoadingScreen?: ComponentType<AuthLoadingScreenProps>;
60
- ErrorScreen?: ComponentType<AuthErrorScreenProps>;
61
- };
62
61
  export interface AuthContextValue {
63
62
  user: PofsisUser | null;
64
63
  session: SessionPayload | null;
@@ -78,18 +77,18 @@ export interface AuthContextValue {
78
77
  completeCallback: (code: string, state: string) => Promise<void>;
79
78
  }
80
79
  export type PofsisAuthProps = {
81
- children: ReactNode;
82
- /** Auth identity/application label. */
80
+ children: import('react').ReactNode;
81
+ /** Identity label registered with POFSIS Auth. */
83
82
  appName: string;
84
83
  /** Auth API base URL. */
85
84
  apiBaseUrl: string;
86
- /** OAuth authorization endpoint. */
85
+ /** OAuth authorize URL. */
87
86
  authUrl: string;
88
- /** OAuth scope. Defaults to openid profile email. */
87
+ /** OAuth scope. Defaults to `openid profile email`. */
89
88
  scope?: string;
90
89
  /** Where to send the user after a successful callback. Default `/`. */
91
90
  postLoginPath?: string;
92
- /** Replace the package's default loading or error UI. */
91
+ /** Override the package's default loading and error screens. */
93
92
  components?: AuthComponentOverrides;
94
93
  };
95
94
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErD,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,UAAU,CAAA;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc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,CAAA;KAC3B,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B,yBAAyB,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7F,yBAAyB,EAAE,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;IACjF,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACnE;AAED,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,EAAE,OAAO,OAAO,EAAE,SAAS,CAAA;IACnC,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gEAAgE;IAChE,UAAU,CAAC,EAAE,sBAAsB,CAAA;CACtC,CAAA"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@pofsis-nbt/pofsis-auth",
3
- "version": "0.1.0",
3
+ "version": "1.0.1",
4
+ "description": "POFSIS OAuth/PKCE authentication client for React applications.",
4
5
  "type": "module",
5
- "description": "React OAuth/PKCE client for POFSIS applications.",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "README.md",
21
- "API.md"
21
+ "Documentation.md"
22
22
  ],
23
23
  "sideEffects": [
24
24
  "**/*.css"
@@ -27,13 +27,15 @@
27
27
  "node": "^20.19.0 || >=22.12.0"
28
28
  },
29
29
  "scripts": {
30
- "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
30
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
31
31
  "typecheck": "tsc --noEmit -p tsconfig.json",
32
32
  "test": "tsx --test src/**/*.test.ts",
33
33
  "check": "npm run typecheck && npm test",
34
34
  "build": "npm run clean && vite build && tsc -p tsconfig.build.json",
35
35
  "prepack": "npm run check && npm run build",
36
- "pack:check": "npm pack --dry-run --json"
36
+ "pack:check": "npm pack --dry-run --json",
37
+ "format": "prettier --write .",
38
+ "format:check": "prettier --check ."
37
39
  },
38
40
  "peerDependencies": {
39
41
  "axios": ">=1",
@@ -50,6 +52,7 @@
50
52
  "@types/react": "^19.2.0",
51
53
  "@types/react-dom": "^19.2.0",
52
54
  "axios": "^1.19.0",
55
+ "prettier": "^3.6.0",
53
56
  "react": "^19.2.0",
54
57
  "react-dom": "^19.2.0",
55
58
  "tsx": "^4.20.0",
package/API.md DELETED
@@ -1,166 +0,0 @@
1
- # @pofsis-nbt/pofsis-auth API
2
-
3
- Import supported APIs from `@pofsis-nbt/pofsis-auth`. Import component CSS separately from `@pofsis-nbt/pofsis-auth/style.css`. Internal source paths are not public entry points.
4
-
5
- ## `PofsisAuth`
6
-
7
- Provides authentication state, restores refresh-cookie sessions, performs OAuth/PKCE redirects and callback exchange, coordinates cross-tab logout, and owns `/login`, `/auth/callback`, and `/auth/error`.
8
-
9
- ```tsx
10
- <PofsisAuth
11
- appName="Orbit"
12
- apiBaseUrl="https://auth.example.com/api"
13
- authUrl="https://auth.example.com/authorize"
14
- scope="openid profile email"
15
- postLoginPath="/"
16
- components={{ LoadingScreen, ErrorScreen }}
17
- >
18
- <App />
19
- </PofsisAuth>
20
- ```
21
-
22
- ### `PofsisAuthProps`
23
-
24
- | Property | Type | Default | Purpose |
25
- | --------------- | ------------------------ | ---------------------- | ---------------------------------------- |
26
- | `children` | `ReactNode` | Required | Application tree receiving auth context. |
27
- | `appName` | `string` | Required | Auth identity/application label. |
28
- | `apiBaseUrl` | `string` | Required | POFSIS Auth API base URL. |
29
- | `authUrl` | `string` | Required | OAuth authorization endpoint. |
30
- | `scope` | `string` | `openid profile email` | OAuth scopes. |
31
- | `postLoginPath` | `string` | `/` | Fallback destination after callback. |
32
- | `components` | `AuthComponentOverrides` | Built-in screens | Loading and error UI overrides. |
33
-
34
- The package does not read environment variables. Consumers resolve environment or runtime settings before rendering this component.
35
-
36
- ## `RequireAuth`
37
-
38
- Renders authenticated children, displays a fallback while authentication is unresolved, and starts login when no session is available.
39
-
40
- ### `RequireAuthProps`
41
-
42
- | Property | Type | Default | Purpose |
43
- | ------------------- | ------------ | ------------------------- | --------------------------------- |
44
- | `children` | `ReactNode` | Required | Authenticated content. |
45
- | `fallback` | `ReactNode` | Configured loading screen | Loading or redirecting content. |
46
- | `onUnauthenticated` | `() => void` | Calls `login()` | Optional router-specific handler. |
47
-
48
- ## `useAuth`
49
-
50
- Returns `AuthContextValue` from the nearest `PofsisAuth` and throws when used outside the provider.
51
-
52
- ### State
53
-
54
- | Value | Type | Meaning |
55
- | ----------------- | ------------------------ | --------------------------------------- |
56
- | `user` | `PofsisUser \| null` | Current account identity. |
57
- | `session` | `SessionPayload \| null` | Current non-token session data. |
58
- | `isAuthenticated` | `boolean` | Whether a session is active. |
59
- | `isLoading` | `boolean` | Whether initial restoration is running. |
60
-
61
- ### `login(options?)`
62
-
63
- Starts OAuth authorization. `AuthLaunchOptions` supports:
64
-
65
- | Property | Type | Behavior |
66
- | ----------- | ---------------------------------------------- | ----------------------------------------- |
67
- | `screen` | `'login' \| 'signup' \| 'reset' \| 'register'` | Auth screen; `register` aliases `signup`. |
68
- | `loginHint` | `string` | Valid email or Philippine mobile hint. |
69
- | `method` | `'password' \| 'passkey' \| 'otp'` | Login-only method hint. |
70
- | `returnUrl` | `string` | Safe local path restored after callback. |
71
-
72
- The `/login` route maps `screen`, `login_hint`, `method`, and legacy `email` query parameters into these options. `login_hint` takes precedence over `email`. Invalid or oversized hints are ignored.
73
-
74
- ### `logout()`
75
-
76
- Posts to remote logout, clears local state, broadcasts logout to other tabs, and navigates to the registered logout URI or `/login`. Local cleanup still occurs if the remote request fails.
77
-
78
- ### `refreshSession()`
79
-
80
- Uses the registered OAuth client and refresh cookie to request an in-memory access token and session. Concurrent calls share one request.
81
-
82
- ### `getAccessToken()`
83
-
84
- Returns the current in-memory access token as `string | null` without triggering refresh.
85
-
86
- ### `getAccountProfile()`
87
-
88
- Returns `Promise<AccountProfile>`, refreshing authentication when required and synchronizing returned profile fields into the context user.
89
-
90
- ### `updateAccountProfile(profile)`
91
-
92
- Accepts `{ firstName?: string | null; lastName?: string | null }` and returns the synchronized `AccountProfile`.
93
-
94
- ### `uploadAccountProfileImage(kind, file)`
95
-
96
- Uploads a `File` for kind `'profile'` or `'cover'` and returns the synchronized `AccountProfile`.
97
-
98
- ### `deleteAccountProfileImage(kind)`
99
-
100
- Deletes the `'profile'` or `'cover'` image and returns the synchronized `AccountProfile`.
101
-
102
- ### `completeCallback(code, state)`
103
-
104
- Verifies OAuth state and the PKCE verifier, exchanges the authorization code, and accepts the session. `PofsisAuth` normally calls this automatically.
105
-
106
- ## Components
107
-
108
- ### `AuthLoadingScreen`
109
-
110
- Default full-page loading UI. `AuthLoadingScreenProps.callback` selects callback-specific copy.
111
-
112
- ### `AuthErrorScreen`
113
-
114
- Default full-page error UI. `AuthErrorScreenProps.retryHref` defaults to `/login`.
115
-
116
- ### `AuthComponentOverrides`
117
-
118
- ```ts
119
- type AuthComponentOverrides = {
120
- LoadingScreen?: ComponentType<AuthLoadingScreenProps>
121
- ErrorScreen?: ComponentType<AuthErrorScreenProps>
122
- }
123
- ```
124
-
125
- ## `attachAuthInterceptor`
126
-
127
- ```ts
128
- const detach = attachAuthInterceptor(client, getToken, refresh)
129
- ```
130
-
131
- Adds a Bearer token to Axios requests and retries one failed request after a `401` refresh. The returned cleanup function ejects both interceptors.
132
-
133
- ## `resolveConfig`
134
-
135
- ```ts
136
- const config = resolveConfig({
137
- appName: 'Orbit',
138
- apiBaseUrl: 'https://auth.example.com/api',
139
- authUrl: 'https://auth.example.com/authorize',
140
- })
141
- ```
142
-
143
- Validates caller-supplied configuration, removes one trailing slash from URL values, defaults the scope, and throws when required values are missing. `ConfigOverrides` remains the accepted input type for direct validation.
144
-
145
- ## Exported types
146
-
147
- - `PofsisAuthProps`
148
- - `RequireAuthProps`
149
- - `PofsisAuthConfig`
150
- - `ConfigOverrides`
151
- - `PofsisUser`
152
- - `AccountProfile`
153
- - `SessionPayload`
154
- - `TokenResponse`
155
- - `OAuthClientConfig`
156
- - `AuthContextValue`
157
- - `AuthLaunchOptions`
158
- - `AuthScreen`
159
- - `AuthMethod`
160
- - `AuthComponentOverrides`
161
- - `AuthLoadingScreenProps`
162
- - `AuthErrorScreenProps`
163
-
164
- ## Internal APIs
165
-
166
- Raw requests, PKCE utilities, launch-option normalization, context construction, callback routing, and source assets are private. Consumers must not import from `src`, `dist/auth`, `dist/components`, or `dist/context`; only exported package subpaths are supported.