@auth/solid-start 0.1.1 → 0.1.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/client.d.ts +20 -2
- package/package.json +3 -4
- package/src/client.ts +28 -7
package/client.d.ts
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import { LiteralUnion, SignInOptions, SignInAuthorizationParams, SignOutParams } from 'next-auth/react';
|
|
2
1
|
import { RedirectableProviderType, BuiltInProviderType } from '@auth/core/providers';
|
|
3
2
|
|
|
3
|
+
type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>);
|
|
4
|
+
interface SignInOptions extends Record<string, unknown> {
|
|
5
|
+
/**
|
|
6
|
+
* Specify to which URL the user will be redirected after signing in. Defaults to the page URL the sign-in is initiated from.
|
|
7
|
+
*
|
|
8
|
+
* [Documentation](https://next-auth.js.org/getting-started/client#specifying-a-callbackurl)
|
|
9
|
+
*/
|
|
10
|
+
callbackUrl?: string;
|
|
11
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#using-the-redirect-false-option) */
|
|
12
|
+
redirect?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface SignOutParams<R extends boolean = true> {
|
|
15
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#specifying-a-callbackurl-1) */
|
|
16
|
+
callbackUrl?: string;
|
|
17
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#using-the-redirect-false-option-1 */
|
|
18
|
+
redirect?: R;
|
|
19
|
+
}
|
|
20
|
+
/** Match `inputType` of `new URLSearchParams(inputType)` */
|
|
21
|
+
type SignInAuthorizationParams = string | string[][] | Record<string, string> | URLSearchParams;
|
|
4
22
|
/**
|
|
5
23
|
* Client-side method to initiate a signin flow
|
|
6
24
|
* or send the user to the signin page listing all possible providers.
|
|
@@ -17,4 +35,4 @@ declare function signIn<P extends RedirectableProviderType | undefined = undefin
|
|
|
17
35
|
*/
|
|
18
36
|
declare function signOut(options?: SignOutParams): Promise<void>;
|
|
19
37
|
|
|
20
|
-
export { signIn, signOut };
|
|
38
|
+
export { SignInAuthorizationParams, signIn, signOut };
|
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.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"client.*",
|
|
@@ -28,9 +28,8 @@
|
|
|
28
28
|
"solid-js": "^1.5.7",
|
|
29
29
|
"solid-start": "^0.2.14",
|
|
30
30
|
"tsup": "^6.5.0",
|
|
31
|
-
"typescript": "
|
|
32
|
-
"@auth/core": "0.
|
|
33
|
-
"next-auth": "4.18.6"
|
|
31
|
+
"typescript": "5.2.2",
|
|
32
|
+
"@auth/core": "0.16.0"
|
|
34
33
|
},
|
|
35
34
|
"peerDependencies": {
|
|
36
35
|
"@auth/core": "~0.2.2 || ^0.2.2",
|
package/src/client.ts
CHANGED
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
LiteralUnion,
|
|
3
|
-
SignInOptions,
|
|
4
|
-
SignInAuthorizationParams,
|
|
5
|
-
SignOutParams,
|
|
6
|
-
} from "next-auth/react"
|
|
7
1
|
import type {
|
|
8
2
|
BuiltInProviderType,
|
|
9
3
|
RedirectableProviderType,
|
|
10
4
|
} from "@auth/core/providers"
|
|
11
5
|
|
|
6
|
+
type LiteralUnion<T extends U, U = string> = T | (U & Record<never, never>)
|
|
7
|
+
|
|
8
|
+
interface SignInOptions extends Record<string, unknown> {
|
|
9
|
+
/**
|
|
10
|
+
* Specify to which URL the user will be redirected after signing in. Defaults to the page URL the sign-in is initiated from.
|
|
11
|
+
*
|
|
12
|
+
* [Documentation](https://next-auth.js.org/getting-started/client#specifying-a-callbackurl)
|
|
13
|
+
*/
|
|
14
|
+
callbackUrl?: string
|
|
15
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#using-the-redirect-false-option) */
|
|
16
|
+
redirect?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface SignOutParams<R extends boolean = true> {
|
|
20
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#specifying-a-callbackurl-1) */
|
|
21
|
+
callbackUrl?: string
|
|
22
|
+
/** [Documentation](https://next-auth.js.org/getting-started/client#using-the-redirect-false-option-1 */
|
|
23
|
+
redirect?: R
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Match `inputType` of `new URLSearchParams(inputType)` */
|
|
27
|
+
export type SignInAuthorizationParams =
|
|
28
|
+
| string
|
|
29
|
+
| string[][]
|
|
30
|
+
| Record<string, string>
|
|
31
|
+
| URLSearchParams
|
|
32
|
+
|
|
12
33
|
/**
|
|
13
34
|
* Client-side method to initiate a signin flow
|
|
14
35
|
* or send the user to the signin page listing all possible providers.
|
|
@@ -51,7 +72,7 @@ export async function signIn<
|
|
|
51
72
|
"Content-Type": "application/x-www-form-urlencoded",
|
|
52
73
|
"X-Auth-Return-Redirect": "1",
|
|
53
74
|
},
|
|
54
|
-
// @ts-
|
|
75
|
+
// @ts-ignore
|
|
55
76
|
body: new URLSearchParams({
|
|
56
77
|
...options,
|
|
57
78
|
csrfToken,
|