own-auth 0.1.2 → 0.1.3
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 +1 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ DATABASE_URL=postgres://localhost:5432/own_auth
|
|
|
15
15
|
OWN_AUTH_TOKEN_PEPPER=replace-with-a-long-random-secret
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Own Auth
|
|
18
|
+
Own Auth stores data in Postgres. `DATABASE_URL` points Own Auth to your Postgres database.
|
|
19
19
|
|
|
20
20
|
## Create Auth
|
|
21
21
|
|
|
@@ -51,26 +51,9 @@ const session = await auth.getCurrentSession(sessionToken);
|
|
|
51
51
|
await auth.signOut(sessionToken);
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
## Advanced Storage Wiring
|
|
55
|
-
|
|
56
|
-
Most apps should use `DATABASE_URL`.
|
|
57
|
-
|
|
58
|
-
If you already have a Postgres client and want to pass it yourself:
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
import { createOwnAuth } from "own-auth";
|
|
62
|
-
import { PostgresAuthStorage } from "own-auth/postgres";
|
|
63
|
-
|
|
64
|
-
export const auth = createOwnAuth({
|
|
65
|
-
storage: new PostgresAuthStorage(pool),
|
|
66
|
-
tokenPepper: process.env.OWN_AUTH_TOKEN_PEPPER
|
|
67
|
-
});
|
|
68
|
-
```
|
|
69
|
-
|
|
70
54
|
## Exports
|
|
71
55
|
|
|
72
56
|
- `own-auth`: auth engine, providers, types, test storage
|
|
73
|
-
- `own-auth/postgres`: manual Postgres storage wiring, hosted project storage, SQL table names
|
|
74
57
|
- `own-auth/migrations/001_initial.sql`: core auth tables
|
|
75
58
|
- `own-auth/migrations/002_hosted_projects.sql`: hosted project tables
|
|
76
59
|
|