@clivly/auth-workos 0.7.0 → 0.7.2
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/README.md +19 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
# @clivly/auth-workos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
WorkOS implementation of Clivly's `ClivlyAuthAdapter`. It reads the host app's
|
|
4
|
+
AuthKit session cookie, authenticates it through WorkOS, and maps the user into
|
|
5
|
+
Clivly's auth shape.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
> The user mapper, cookie reader, and session resolution are unit-tested;
|
|
7
|
-
> broader host-app compatibility coverage is still growing.
|
|
7
|
+
## Install
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install @clivly/auth-workos @workos-inc/node
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This adapter is a Tier 2 surface in
|
|
14
|
+
[STABILITY.md](https://github.com/amani-joseph/clivly.com/blob/master/STABILITY.md).
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
10
17
|
|
|
11
18
|
```ts
|
|
12
19
|
import { createWorkOSAuthAdapter } from "@clivly/auth-workos";
|
|
@@ -15,11 +22,17 @@ const authAdapter = createWorkOSAuthAdapter({
|
|
|
15
22
|
apiKey: process.env.WORKOS_API_KEY!,
|
|
16
23
|
clientId: process.env.WORKOS_CLIENT_ID!,
|
|
17
24
|
cookiePassword: process.env.WORKOS_COOKIE_PASSWORD!,
|
|
25
|
+
// optional:
|
|
26
|
+
// cookieName: "wos-session",
|
|
18
27
|
});
|
|
19
28
|
|
|
20
|
-
const user = await authAdapter.getUser(request);
|
|
29
|
+
const user = await authAdapter.getUser(request);
|
|
30
|
+
// { id, email, name } | null
|
|
21
31
|
```
|
|
22
32
|
|
|
33
|
+
Returns `null` when there is no session cookie or the WorkOS session does not
|
|
34
|
+
authenticate.
|
|
35
|
+
|
|
23
36
|
## License
|
|
24
37
|
|
|
25
38
|
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clivly/auth-workos",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "WorkOS implementation of Clivly's ClivlyAuthAdapter.",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@clivly/core": "0.7.
|
|
28
|
+
"@clivly/core": "0.7.2"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@workos-inc/node": ">=7"
|