@caffeinebounce/identity 0.12.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/LICENSE +21 -0
- package/README.md +46 -0
- package/dist/index.d.mts +778 -0
- package/dist/index.d.ts +778 -0
- package/dist/index.js +5847 -0
- package/dist/index.mjs +5795 -0
- package/dist/server.d.mts +110 -0
- package/dist/server.d.ts +110 -0
- package/dist/server.js +295 -0
- package/dist/server.mjs +277 -0
- package/package.json +84 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Doug Ebanks
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @caffeinebounce/identity
|
|
2
|
+
|
|
3
|
+
Reusable auth UI, Supabase auth helpers, callback handler contracts, and
|
|
4
|
+
identity utilities.
|
|
5
|
+
|
|
6
|
+
## Public Entrypoints
|
|
7
|
+
|
|
8
|
+
- `@caffeinebounce/identity` exports auth UI, client-facing hooks, callback
|
|
9
|
+
handler types, and shared identity utilities.
|
|
10
|
+
- `@caffeinebounce/identity/server` exports server-safe callback handlers and
|
|
11
|
+
utilities without client component directives.
|
|
12
|
+
|
|
13
|
+
## Auth Callback Policy
|
|
14
|
+
|
|
15
|
+
`createAuthCallbackHandler` owns reusable OAuth and OTP callback mechanics:
|
|
16
|
+
safe redirect parsing, Supabase exchange/verification, authenticated user
|
|
17
|
+
lookup, post-auth hooks, and error redirects.
|
|
18
|
+
|
|
19
|
+
Consumers own product-specific policy. Use `postAuthHook` for app-local setup,
|
|
20
|
+
`resolveSuccessRedirect` for role or approval routing, `isLinkingFlow` for
|
|
21
|
+
consumer account-linking routes, and `resolveLinkingErrorMessage` for branded
|
|
22
|
+
linking-error copy.
|
|
23
|
+
|
|
24
|
+
## Belongs Here
|
|
25
|
+
|
|
26
|
+
- Shared sign-in, sign-up, password reset, MFA, account settings, callback, and
|
|
27
|
+
redirect behavior.
|
|
28
|
+
- Typed auth contracts that multiple apps can wire to their own routes.
|
|
29
|
+
|
|
30
|
+
## Does Not Belong Here
|
|
31
|
+
|
|
32
|
+
- App-specific authorization policy, private route structure, branded auth copy,
|
|
33
|
+
database migrations, or org-specific business rules.
|
|
34
|
+
|
|
35
|
+
## Focused Commands
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
corepack yarn turbo run lint typecheck test build --filter=@caffeinebounce/identity
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Gotchas
|
|
42
|
+
|
|
43
|
+
- Keep client and server surfaces separate.
|
|
44
|
+
- Do not import browser-only code from `@caffeinebounce/identity/server`.
|
|
45
|
+
- Preserve callback and redirect behavior as public contracts.
|
|
46
|
+
- Add a changeset for published behavior, source, manifest, or export changes.
|