@auth/solid-start 0.11.0 → 0.12.0

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.
Files changed (2) hide show
  1. package/README.MD +18 -80
  2. package/package.json +2 -2
package/README.MD CHANGED
@@ -1,80 +1,18 @@
1
- # Getting started
2
-
3
- Recommended to use [create-jd-app](https://github.com/OrJDev/create-jd-app)
4
-
5
- ```bash
6
- npm install @auth/solid-start@latest @auth/core@latest
7
- ```
8
-
9
- ## Setting It Up
10
-
11
- [Generate auth secret](https://generate-secret.vercel.app/32), then set it as an environment variable:
12
-
13
- ```
14
- AUTH_SECRET=your_auth_secret
15
- ```
16
-
17
- ### On Production
18
-
19
- Don't forget to trust the host.
20
-
21
- ```
22
- AUTH_TRUST_HOST=true
23
- ```
24
-
25
- ## Creating the api handler
26
-
27
- in this example we are using github so make sure to set the following environment variables:
28
-
29
- ```
30
- GITHUB_ID=your_github_oauth_id
31
- GITHUB_SECRET=your_github_oauth_secret
32
- ```
33
-
34
- ```ts
35
- // routes/api/auth/[...solidauth].ts
36
- import { SolidAuth, type SolidAuthConfig } from "@auth/solid-start"
37
- import GitHub from "@auth/core/providers/github"
38
-
39
- export const authOpts: SolidAuthConfig = {
40
- providers: [
41
- GitHub({
42
- clientId: process.env.GITHUB_ID,
43
- clientSecret: process.env.GITHUB_SECRET,
44
- }),
45
- ],
46
- debug: false,
47
- }
48
-
49
- export const { GET, POST } = SolidAuth(authOpts)
50
- ```
51
-
52
- ## Signing in and out
53
-
54
- ```ts
55
- import { signIn, signOut } from "@auth/solid-start/client"
56
- const login = () => signIn("github")
57
- const logout = () => signOut()
58
- ```
59
-
60
- ## Getting the current session
61
-
62
- ```ts
63
- import { getSession } from "@auth/solid-start"
64
- import { createServerData$ } from "solid-start/server"
65
- import { authOpts } from "~/routes/api/auth/[...solidauth]"
66
-
67
- export const useSession = () => {
68
- return createServerData$(
69
- async (_, { request }) => {
70
- return await getSession(request, authOpts)
71
- },
72
- { key: () => ["auth_user"] }
73
- )
74
- }
75
-
76
- // useSession returns a resource:
77
- const session = useSession()
78
- const loading = session.loading
79
- const user = () => session()?.user
80
- ```
1
+ <p align="center">
2
+ <a href="https://start.solidjs.com" target="_blank"><img height="96px" src="https://authjs.dev/img/etc/solidstart.svg" /></a>
3
+ <a href="https://solid-start.authjs.dev" target="_blank"><img height="96px" src="https://authjs.dev/img/logo-sm.png" /></a>
4
+ <h1 align="center">SolidStart Auth</h1>
5
+ </p>
6
+ <p align="center">
7
+ Authentication for SolidStart.
8
+ </p>
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/package/@auth/solid-start"><img src="https://img.shields.io/npm/v/@auth/solid-start?style=flat-square&label=latest&color=purple" alt="npm latest release" /></a>
11
+ <a href="https://www.npmtrends.com/@auth/solid-start"><img src="https://img.shields.io/npm/dm/@auth/solid-start?style=flat-square&color=cyan" alt="Downloads" /></a>
12
+ <a href="https://github.com/nextauthjs/next-auth/stargazers"><img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square&color=orange" alt="Github Stars" /></a>
13
+ <img src="https://shields.io/badge/TypeScript-3178C6?logo=TypeScript&logoColor=fff&style=flat-square" alt="TypeScript" />
14
+ </p>
15
+
16
+ ---
17
+
18
+ Check out the documentation at [solid-start.authjs.dev](https://solid-start.authjs.dev).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@auth/solid-start",
3
3
  "description": "Authentication for SolidStart.",
4
- "version": "0.11.0",
4
+ "version": "0.12.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "*.js",
@@ -26,7 +26,7 @@
26
26
  "access": "public"
27
27
  },
28
28
  "dependencies": {
29
- "@auth/core": "0.33.0"
29
+ "@auth/core": "0.34.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@solidjs/meta": "^0.28.0",