@supabase/gotrue-js 1.16.7 → 1.19.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.
- package/README.md +3 -3
- package/dist/main/GoTrueApi.d.ts +80 -12
- package/dist/main/GoTrueApi.d.ts.map +1 -1
- package/dist/main/GoTrueApi.js +109 -3
- package/dist/main/GoTrueApi.js.map +1 -1
- package/dist/main/GoTrueClient.d.ts +41 -15
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +84 -24
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/constants.d.ts +3 -1
- package/dist/main/lib/constants.d.ts.map +1 -1
- package/dist/main/lib/constants.js +2 -1
- package/dist/main/lib/constants.js.map +1 -1
- package/dist/main/lib/helpers.d.ts +0 -11
- package/dist/main/lib/helpers.d.ts.map +1 -1
- package/dist/main/lib/helpers.js +1 -22
- package/dist/main/lib/helpers.js.map +1 -1
- package/dist/main/lib/types.d.ts +11 -1
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/version.d.ts +2 -0
- package/dist/main/lib/version.d.ts.map +1 -0
- package/dist/main/lib/version.js +6 -0
- package/dist/main/lib/version.js.map +1 -0
- package/dist/module/GoTrueApi.d.ts +80 -12
- package/dist/module/GoTrueApi.d.ts.map +1 -1
- package/dist/module/GoTrueApi.js +109 -3
- package/dist/module/GoTrueApi.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts +41 -15
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +85 -25
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/constants.d.ts +3 -1
- package/dist/module/lib/constants.d.ts.map +1 -1
- package/dist/module/lib/constants.js +2 -1
- package/dist/module/lib/constants.js.map +1 -1
- package/dist/module/lib/helpers.d.ts +0 -11
- package/dist/module/lib/helpers.d.ts.map +1 -1
- package/dist/module/lib/helpers.js +0 -20
- package/dist/module/lib/helpers.js.map +1 -1
- package/dist/module/lib/types.d.ts +11 -1
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/version.d.ts +2 -0
- package/dist/module/lib/version.d.ts.map +1 -0
- package/dist/module/lib/version.js +3 -0
- package/dist/module/lib/version.js.map +1 -0
- package/package.json +6 -4
- package/src/GoTrueApi.ts +158 -14
- package/src/GoTrueClient.ts +124 -35
- package/src/lib/constants.ts +2 -1
- package/src/lib/helpers.ts +0 -24
- package/src/lib/types.ts +13 -0
- package/src/lib/version.ts +2 -0
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ const GOTRUE_URL = 'http://localhost:9999'
|
|
|
25
25
|
const auth = new GoTrueClient({ url: GOTRUE_URL })
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
- `signUp()`: https://supabase.io/docs/
|
|
29
|
-
- `signIn()`: https://supabase.io/docs/
|
|
30
|
-
- `signOut()`: https://supabase.io/docs/
|
|
28
|
+
- `signUp()`: https://supabase.io/docs/reference/javascript/auth-signup
|
|
29
|
+
- `signIn()`: https://supabase.io/docs/reference/javascript/auth-signin
|
|
30
|
+
- `signOut()`: https://supabase.io/docs/reference/javascript/auth-signout
|
|
31
31
|
|
|
32
32
|
## Sponsors
|
|
33
33
|
|
package/dist/main/GoTrueApi.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Session, Provider, UserAttributes, CookieOptions, User } from './lib/types';
|
|
2
|
+
export interface ApiError {
|
|
3
|
+
message: string;
|
|
4
|
+
status: number;
|
|
5
|
+
}
|
|
2
6
|
export default class GoTrueApi {
|
|
3
7
|
protected url: string;
|
|
4
8
|
protected headers: {
|
|
@@ -17,15 +21,17 @@ export default class GoTrueApi {
|
|
|
17
21
|
* @param email The email address of the user.
|
|
18
22
|
* @param password The password of the user.
|
|
19
23
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
24
|
+
* @param data Optional user metadata.
|
|
20
25
|
*
|
|
21
26
|
* @returns A logged-in session if the server has "autoconfirm" ON
|
|
22
27
|
* @returns A user if the server has "autoconfirm" OFF
|
|
23
28
|
*/
|
|
24
29
|
signUpWithEmail(email: string, password: string, options?: {
|
|
25
30
|
redirectTo?: string;
|
|
31
|
+
data?: object;
|
|
26
32
|
}): Promise<{
|
|
27
33
|
data: Session | User | null;
|
|
28
|
-
error:
|
|
34
|
+
error: ApiError | null;
|
|
29
35
|
}>;
|
|
30
36
|
/**
|
|
31
37
|
* Logs in an existing user using their email address.
|
|
@@ -37,7 +43,28 @@ export default class GoTrueApi {
|
|
|
37
43
|
redirectTo?: string;
|
|
38
44
|
}): Promise<{
|
|
39
45
|
data: Session | null;
|
|
40
|
-
error:
|
|
46
|
+
error: ApiError | null;
|
|
47
|
+
}>;
|
|
48
|
+
/**
|
|
49
|
+
* Signs up a new user using their phone number and a password.
|
|
50
|
+
* @param phone The phone number of the user.
|
|
51
|
+
* @param password The password of the user.
|
|
52
|
+
* @param data Optional user metadata.
|
|
53
|
+
*/
|
|
54
|
+
signUpWithPhone(phone: string, password: string, options?: {
|
|
55
|
+
data?: object;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
data: Session | User | null;
|
|
58
|
+
error: ApiError | null;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Logs in an existing user using their phone number and password.
|
|
62
|
+
* @param phone The phone number of the user.
|
|
63
|
+
* @param password The password of the user.
|
|
64
|
+
*/
|
|
65
|
+
signInWithPhone(phone: string, password: string): Promise<{
|
|
66
|
+
data: Session | null;
|
|
67
|
+
error: ApiError | null;
|
|
41
68
|
}>;
|
|
42
69
|
/**
|
|
43
70
|
* Sends a magic login link to an email address.
|
|
@@ -48,18 +75,40 @@ export default class GoTrueApi {
|
|
|
48
75
|
redirectTo?: string;
|
|
49
76
|
}): Promise<{
|
|
50
77
|
data: {} | null;
|
|
51
|
-
error:
|
|
78
|
+
error: ApiError | null;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Sends a mobile OTP via SMS. Will register the account if it doesn't already exist
|
|
82
|
+
* @param phone The user's phone number WITH international prefix
|
|
83
|
+
*/
|
|
84
|
+
sendMobileOTP(phone: string): Promise<{
|
|
85
|
+
data: {} | null;
|
|
86
|
+
error: ApiError | null;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Send User supplied Mobile OTP to be verified
|
|
90
|
+
* @param phone The user's phone number WITH international prefix
|
|
91
|
+
* @param token token that user was sent to their mobile phone
|
|
92
|
+
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
93
|
+
*/
|
|
94
|
+
verifyMobileOTP(phone: string, token: string, options?: {
|
|
95
|
+
redirectTo?: string;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
data: Session | User | null;
|
|
98
|
+
error: ApiError | null;
|
|
52
99
|
}>;
|
|
53
100
|
/**
|
|
54
101
|
* Sends an invite link to an email address.
|
|
55
102
|
* @param email The email address of the user.
|
|
56
103
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
104
|
+
* @param data Optional user metadata
|
|
57
105
|
*/
|
|
58
106
|
inviteUserByEmail(email: string, options?: {
|
|
59
107
|
redirectTo?: string;
|
|
108
|
+
data?: object;
|
|
60
109
|
}): Promise<{
|
|
61
110
|
data: User | null;
|
|
62
|
-
error:
|
|
111
|
+
error: ApiError | null;
|
|
63
112
|
}>;
|
|
64
113
|
/**
|
|
65
114
|
* Sends a reset request to an email address.
|
|
@@ -70,7 +119,7 @@ export default class GoTrueApi {
|
|
|
70
119
|
redirectTo?: string;
|
|
71
120
|
}): Promise<{
|
|
72
121
|
data: {} | null;
|
|
73
|
-
error:
|
|
122
|
+
error: ApiError | null;
|
|
74
123
|
}>;
|
|
75
124
|
/**
|
|
76
125
|
* Create a temporary object with all configured headers and
|
|
@@ -83,7 +132,7 @@ export default class GoTrueApi {
|
|
|
83
132
|
* @param jwt A valid, logged-in JWT.
|
|
84
133
|
*/
|
|
85
134
|
signOut(jwt: string): Promise<{
|
|
86
|
-
error:
|
|
135
|
+
error: ApiError | null;
|
|
87
136
|
}>;
|
|
88
137
|
/**
|
|
89
138
|
* Generates the relevant login URL for a third-party provider.
|
|
@@ -102,7 +151,7 @@ export default class GoTrueApi {
|
|
|
102
151
|
getUser(jwt: string): Promise<{
|
|
103
152
|
user: User | null;
|
|
104
153
|
data: User | null;
|
|
105
|
-
error:
|
|
154
|
+
error: ApiError | null;
|
|
106
155
|
}>;
|
|
107
156
|
/**
|
|
108
157
|
* Updates the user data.
|
|
@@ -112,17 +161,20 @@ export default class GoTrueApi {
|
|
|
112
161
|
updateUser(jwt: string, attributes: UserAttributes): Promise<{
|
|
113
162
|
user: User | null;
|
|
114
163
|
data: User | null;
|
|
115
|
-
error:
|
|
164
|
+
error: ApiError | null;
|
|
116
165
|
}>;
|
|
117
166
|
/**
|
|
118
|
-
* Delete
|
|
167
|
+
* Delete a user. Requires a `service_role` key.
|
|
168
|
+
*
|
|
169
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
170
|
+
*
|
|
119
171
|
* @param uid The user uid you want to remove.
|
|
120
172
|
* @param jwt A valid JWT. Must be a full-access API key (e.g. service_role key).
|
|
121
173
|
*/
|
|
122
174
|
deleteUser(uid: string, jwt: string): Promise<{
|
|
123
175
|
user: User | null;
|
|
124
176
|
data: User | null;
|
|
125
|
-
error:
|
|
177
|
+
error: ApiError | null;
|
|
126
178
|
}>;
|
|
127
179
|
/**
|
|
128
180
|
* Generates a new JWT.
|
|
@@ -130,7 +182,7 @@ export default class GoTrueApi {
|
|
|
130
182
|
*/
|
|
131
183
|
refreshAccessToken(refreshToken: string): Promise<{
|
|
132
184
|
data: Session | null;
|
|
133
|
-
error:
|
|
185
|
+
error: ApiError | null;
|
|
134
186
|
}>;
|
|
135
187
|
/**
|
|
136
188
|
* Set/delete the auth cookie based on the AuthChangeEvent.
|
|
@@ -144,7 +196,23 @@ export default class GoTrueApi {
|
|
|
144
196
|
getUserByCookie(req: any): Promise<{
|
|
145
197
|
user: User | null;
|
|
146
198
|
data: User | null;
|
|
147
|
-
error:
|
|
199
|
+
error: ApiError | null;
|
|
200
|
+
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Generates links to be sent via email or other.
|
|
203
|
+
* @param type The link type ("signup" or "magiclink" or "recovery" or "invite").
|
|
204
|
+
* @param email The user's email.
|
|
205
|
+
* @param password User password. For signup only.
|
|
206
|
+
* @param data Optional user metadata. For signup only.
|
|
207
|
+
* @param redirectTo The link type ("signup" or "magiclink" or "recovery" or "invite").
|
|
208
|
+
*/
|
|
209
|
+
generateLink(type: 'signup' | 'magiclink' | 'recovery' | 'invite', email: string, options?: {
|
|
210
|
+
password?: string;
|
|
211
|
+
data?: object;
|
|
212
|
+
redirectTo?: string;
|
|
213
|
+
}): Promise<{
|
|
214
|
+
data: Session | User | null;
|
|
215
|
+
error: ApiError | null;
|
|
148
216
|
}>;
|
|
149
217
|
}
|
|
150
218
|
//# sourceMappingURL=GoTrueApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoTrueApi.d.ts","sourceRoot":"","sources":["../../src/GoTrueApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAKpF,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,SAAS,CAAC,GAAG,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,OAAO,EAAE;QACjB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAA;gBAE1B,EACV,GAAQ,EACR,OAAY,EACZ,aAAa,GACd,EAAE;QACD,GAAG,EAAE,MAAM,CAAA;QACX,OAAO,CAAC,EAAE;YACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SACtB,CAAA;QACD,aAAa,CAAC,EAAE,aAAa,CAAA;KAC9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AI,EAAE,IAAI,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;KAAE,CAAC;IAe5E;;;OAGG;IACG,kBAAkB,CACtB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;KAAE,CAAC;IAe5D;;;OAGG;IACH,aAAa,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;IAsBhC;;;OAGG;IACG,eAAe,CACnB,GAAG,EAAE,GAAG,GACP,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;QAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;KAAE,CAAC;IAgB5E;;;;;;;OAOG;IACG,YAAY,CAChB,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,EACpD,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;QACP,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,UAAU,CAAC,EAAE,MAAM,CAAA;KACf,GACL,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAA;KAAE,CAAC;CAkBpE"}
|
package/dist/main/GoTrueApi.js
CHANGED
|
@@ -24,6 +24,7 @@ class GoTrueApi {
|
|
|
24
24
|
* @param email The email address of the user.
|
|
25
25
|
* @param password The password of the user.
|
|
26
26
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
27
|
+
* @param data Optional user metadata.
|
|
27
28
|
*
|
|
28
29
|
* @returns A logged-in session if the server has "autoconfirm" ON
|
|
29
30
|
* @returns A user if the server has "autoconfirm" OFF
|
|
@@ -36,7 +37,7 @@ class GoTrueApi {
|
|
|
36
37
|
if (options.redirectTo) {
|
|
37
38
|
queryString = '?redirect_to=' + encodeURIComponent(options.redirectTo);
|
|
38
39
|
}
|
|
39
|
-
const data = yield fetch_1.post(`${this.url}/signup${queryString}`, { email, password }, { headers });
|
|
40
|
+
const data = yield fetch_1.post(`${this.url}/signup${queryString}`, { email, password, data: options.data }, { headers });
|
|
40
41
|
let session = Object.assign({}, data);
|
|
41
42
|
if (session.expires_in)
|
|
42
43
|
session.expires_at = helpers_1.expiresAt(data.expires_in);
|
|
@@ -72,6 +73,48 @@ class GoTrueApi {
|
|
|
72
73
|
}
|
|
73
74
|
});
|
|
74
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Signs up a new user using their phone number and a password.
|
|
78
|
+
* @param phone The phone number of the user.
|
|
79
|
+
* @param password The password of the user.
|
|
80
|
+
* @param data Optional user metadata.
|
|
81
|
+
*/
|
|
82
|
+
signUpWithPhone(phone, password, options = {}) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
try {
|
|
85
|
+
let headers = Object.assign({}, this.headers);
|
|
86
|
+
const data = yield fetch_1.post(`${this.url}/signup`, { phone, password, data: options.data }, { headers });
|
|
87
|
+
let session = Object.assign({}, data);
|
|
88
|
+
if (session.expires_in)
|
|
89
|
+
session.expires_at = helpers_1.expiresAt(data.expires_in);
|
|
90
|
+
return { data: session, error: null };
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
return { data: null, error };
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Logs in an existing user using their phone number and password.
|
|
99
|
+
* @param phone The phone number of the user.
|
|
100
|
+
* @param password The password of the user.
|
|
101
|
+
*/
|
|
102
|
+
signInWithPhone(phone, password) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
try {
|
|
105
|
+
let headers = Object.assign({}, this.headers);
|
|
106
|
+
let queryString = '?grant_type=password';
|
|
107
|
+
const data = yield fetch_1.post(`${this.url}/token${queryString}`, { phone, password }, { headers });
|
|
108
|
+
let session = Object.assign({}, data);
|
|
109
|
+
if (session.expires_in)
|
|
110
|
+
session.expires_at = helpers_1.expiresAt(data.expires_in);
|
|
111
|
+
return { data: session, error: null };
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
return { data: null, error };
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
75
118
|
/**
|
|
76
119
|
* Sends a magic login link to an email address.
|
|
77
120
|
* @param email The email address of the user.
|
|
@@ -93,10 +136,45 @@ class GoTrueApi {
|
|
|
93
136
|
}
|
|
94
137
|
});
|
|
95
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Sends a mobile OTP via SMS. Will register the account if it doesn't already exist
|
|
141
|
+
* @param phone The user's phone number WITH international prefix
|
|
142
|
+
*/
|
|
143
|
+
sendMobileOTP(phone) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
try {
|
|
146
|
+
let headers = Object.assign({}, this.headers);
|
|
147
|
+
const data = yield fetch_1.post(`${this.url}/otp`, { phone }, { headers });
|
|
148
|
+
return { data, error: null };
|
|
149
|
+
}
|
|
150
|
+
catch (error) {
|
|
151
|
+
return { data: null, error };
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Send User supplied Mobile OTP to be verified
|
|
157
|
+
* @param phone The user's phone number WITH international prefix
|
|
158
|
+
* @param token token that user was sent to their mobile phone
|
|
159
|
+
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
160
|
+
*/
|
|
161
|
+
verifyMobileOTP(phone, token, options = {}) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
try {
|
|
164
|
+
let headers = Object.assign({}, this.headers);
|
|
165
|
+
const data = yield fetch_1.post(`${this.url}/verify`, { phone, token, type: 'sms', redirect_to: options.redirectTo }, { headers });
|
|
166
|
+
return { data, error: null };
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return { data: null, error };
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
96
173
|
/**
|
|
97
174
|
* Sends an invite link to an email address.
|
|
98
175
|
* @param email The email address of the user.
|
|
99
176
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
177
|
+
* @param data Optional user metadata
|
|
100
178
|
*/
|
|
101
179
|
inviteUserByEmail(email, options = {}) {
|
|
102
180
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -106,7 +184,7 @@ class GoTrueApi {
|
|
|
106
184
|
if (options.redirectTo) {
|
|
107
185
|
queryString += '?redirect_to=' + encodeURIComponent(options.redirectTo);
|
|
108
186
|
}
|
|
109
|
-
const data = yield fetch_1.post(`${this.url}/invite${queryString}`, { email }, { headers });
|
|
187
|
+
const data = yield fetch_1.post(`${this.url}/invite${queryString}`, { email, data: options.data }, { headers });
|
|
110
188
|
return { data, error: null };
|
|
111
189
|
}
|
|
112
190
|
catch (error) {
|
|
@@ -210,7 +288,10 @@ class GoTrueApi {
|
|
|
210
288
|
});
|
|
211
289
|
}
|
|
212
290
|
/**
|
|
213
|
-
* Delete
|
|
291
|
+
* Delete a user. Requires a `service_role` key.
|
|
292
|
+
*
|
|
293
|
+
* This function should only be called on a server. Never expose your `service_role` key in the browser.
|
|
294
|
+
*
|
|
214
295
|
* @param uid The user uid you want to remove.
|
|
215
296
|
* @param jwt A valid JWT. Must be a full-access API key (e.g. service_role key).
|
|
216
297
|
*/
|
|
@@ -295,6 +376,31 @@ class GoTrueApi {
|
|
|
295
376
|
}
|
|
296
377
|
});
|
|
297
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Generates links to be sent via email or other.
|
|
381
|
+
* @param type The link type ("signup" or "magiclink" or "recovery" or "invite").
|
|
382
|
+
* @param email The user's email.
|
|
383
|
+
* @param password User password. For signup only.
|
|
384
|
+
* @param data Optional user metadata. For signup only.
|
|
385
|
+
* @param redirectTo The link type ("signup" or "magiclink" or "recovery" or "invite").
|
|
386
|
+
*/
|
|
387
|
+
generateLink(type, email, options = {}) {
|
|
388
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
389
|
+
try {
|
|
390
|
+
const data = yield fetch_1.post(`${this.url}/admin/generate_link`, {
|
|
391
|
+
type,
|
|
392
|
+
email,
|
|
393
|
+
password: options.password,
|
|
394
|
+
data: options.data,
|
|
395
|
+
redirect_to: options.redirectTo,
|
|
396
|
+
}, { headers: this.headers });
|
|
397
|
+
return { data, error: null };
|
|
398
|
+
}
|
|
399
|
+
catch (error) {
|
|
400
|
+
return { data: null, error };
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
}
|
|
298
404
|
}
|
|
299
405
|
exports.default = GoTrueApi;
|
|
300
406
|
//# sourceMappingURL=GoTrueApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoTrueApi.js","sourceRoot":"","sources":["../../src/GoTrueApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAAoD;AAEpD,+CAAgD;AAChD,2CAAuD;AACvD,2CAAyC;
|
|
1
|
+
{"version":3,"file":"GoTrueApi.js","sourceRoot":"","sources":["../../src/GoTrueApi.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAAoD;AAEpD,+CAAgD;AAChD,2CAAuD;AACvD,2CAAyC;AAOzC,MAAqB,SAAS;IAO5B,YAAY,EACV,GAAG,GAAG,EAAE,EACR,OAAO,GAAG,EAAE,EACZ,aAAa,GAOd;QACC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,aAAa,mCAAQ,0BAAc,GAAK,aAAa,CAAE,CAAA;IAC9D,CAAC;IAED;;;;;;;;;OASG;IACG,eAAe,CACnB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-1,5 +1,11 @@
|
|
|
1
|
-
import GoTrueApi from './GoTrueApi';
|
|
2
|
-
import { Session, User, UserAttributes, Provider, Subscription, AuthChangeEvent, CookieOptions, UserCredentials } from './lib/types';
|
|
1
|
+
import GoTrueApi, { ApiError } from './GoTrueApi';
|
|
2
|
+
import { Session, User, UserAttributes, Provider, Subscription, AuthChangeEvent, CookieOptions, UserCredentials, VerifyOTPParams } from './lib/types';
|
|
3
|
+
declare type AnyFunction = (...args: any[]) => any;
|
|
4
|
+
declare type MaybePromisify<T> = T | Promise<T>;
|
|
5
|
+
declare type PromisifyMethods<T> = {
|
|
6
|
+
[K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
|
|
7
|
+
};
|
|
8
|
+
declare type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>>;
|
|
3
9
|
export default class GoTrueClient {
|
|
4
10
|
/**
|
|
5
11
|
* Namespace for the GoTrue API methods.
|
|
@@ -16,7 +22,7 @@ export default class GoTrueClient {
|
|
|
16
22
|
protected currentSession: Session | null;
|
|
17
23
|
protected autoRefreshToken: boolean;
|
|
18
24
|
protected persistSession: boolean;
|
|
19
|
-
protected localStorage:
|
|
25
|
+
protected localStorage: SupportedStorage;
|
|
20
26
|
protected stateChangeEmitters: Map<string, Subscription>;
|
|
21
27
|
protected refreshTokenTimer?: ReturnType<typeof setTimeout>;
|
|
22
28
|
/**
|
|
@@ -27,6 +33,7 @@ export default class GoTrueClient {
|
|
|
27
33
|
* @param options.autoRefreshToken Set to "true" if you want to automatically refresh the token before expiring.
|
|
28
34
|
* @param options.persistSession Set to "true" if you want to automatically save the user session into local storage.
|
|
29
35
|
* @param options.localStorage
|
|
36
|
+
* @param options.cookieOptions
|
|
30
37
|
*/
|
|
31
38
|
constructor(options: {
|
|
32
39
|
url?: string;
|
|
@@ -36,7 +43,7 @@ export default class GoTrueClient {
|
|
|
36
43
|
detectSessionInUrl?: boolean;
|
|
37
44
|
autoRefreshToken?: boolean;
|
|
38
45
|
persistSession?: boolean;
|
|
39
|
-
localStorage?:
|
|
46
|
+
localStorage?: SupportedStorage;
|
|
40
47
|
cookieOptions?: CookieOptions;
|
|
41
48
|
});
|
|
42
49
|
/**
|
|
@@ -44,14 +51,17 @@ export default class GoTrueClient {
|
|
|
44
51
|
* @type UserCredentials
|
|
45
52
|
* @param email The user's email address.
|
|
46
53
|
* @param password The user's password.
|
|
54
|
+
* @param phone The user's phone number.
|
|
47
55
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
56
|
+
* @param data Optional user metadata.
|
|
48
57
|
*/
|
|
49
|
-
signUp({ email, password }: UserCredentials, options?: {
|
|
58
|
+
signUp({ email, password, phone }: UserCredentials, options?: {
|
|
50
59
|
redirectTo?: string;
|
|
60
|
+
data?: object;
|
|
51
61
|
}): Promise<{
|
|
52
62
|
user: User | null;
|
|
53
63
|
session: Session | null;
|
|
54
|
-
error:
|
|
64
|
+
error: ApiError | null;
|
|
55
65
|
data: Session | User | null;
|
|
56
66
|
}>;
|
|
57
67
|
/**
|
|
@@ -64,7 +74,7 @@ export default class GoTrueClient {
|
|
|
64
74
|
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
65
75
|
* @param scopes A space-separated list of scopes granted to the OAuth application.
|
|
66
76
|
*/
|
|
67
|
-
signIn({ email, password, refreshToken, provider }: UserCredentials, options?: {
|
|
77
|
+
signIn({ email, phone, password, refreshToken, provider }: UserCredentials, options?: {
|
|
68
78
|
redirectTo?: string;
|
|
69
79
|
scopes?: string;
|
|
70
80
|
}): Promise<{
|
|
@@ -72,9 +82,23 @@ export default class GoTrueClient {
|
|
|
72
82
|
user: User | null;
|
|
73
83
|
provider?: Provider;
|
|
74
84
|
url?: string | null;
|
|
75
|
-
error:
|
|
85
|
+
error: ApiError | null;
|
|
76
86
|
data: Session | null;
|
|
77
87
|
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Log in a user given a User supplied OTP received via mobile.
|
|
90
|
+
* @param phone The user's phone number.
|
|
91
|
+
* @param token The user's password.
|
|
92
|
+
* @param redirectTo A URL or mobile address to send the user to after they are confirmed.
|
|
93
|
+
*/
|
|
94
|
+
verifyOTP({ phone, token }: VerifyOTPParams, options?: {
|
|
95
|
+
redirectTo?: string;
|
|
96
|
+
}): Promise<{
|
|
97
|
+
user: User | null;
|
|
98
|
+
session: Session | null;
|
|
99
|
+
error: ApiError | null;
|
|
100
|
+
data: Session | User | null;
|
|
101
|
+
}>;
|
|
78
102
|
/**
|
|
79
103
|
* Inside a browser context, `user()` will return the user data, if there is a logged in user.
|
|
80
104
|
*
|
|
@@ -91,7 +115,7 @@ export default class GoTrueClient {
|
|
|
91
115
|
refreshSession(): Promise<{
|
|
92
116
|
data: Session | null;
|
|
93
117
|
user: User | null;
|
|
94
|
-
error:
|
|
118
|
+
error: ApiError | null;
|
|
95
119
|
}>;
|
|
96
120
|
/**
|
|
97
121
|
* Updates user data, if there is a logged in user.
|
|
@@ -99,7 +123,7 @@ export default class GoTrueClient {
|
|
|
99
123
|
update(attributes: UserAttributes): Promise<{
|
|
100
124
|
data: User | null;
|
|
101
125
|
user: User | null;
|
|
102
|
-
error:
|
|
126
|
+
error: ApiError | null;
|
|
103
127
|
}>;
|
|
104
128
|
/**
|
|
105
129
|
* Sets the session data from refresh_token and returns current Session and Error
|
|
@@ -107,7 +131,7 @@ export default class GoTrueClient {
|
|
|
107
131
|
*/
|
|
108
132
|
setSession(refresh_token: string): Promise<{
|
|
109
133
|
session: Session | null;
|
|
110
|
-
error:
|
|
134
|
+
error: ApiError | null;
|
|
111
135
|
}>;
|
|
112
136
|
/**
|
|
113
137
|
* Overrides the JWT on the current client. The JWT will then be sent in all subsequent network requests.
|
|
@@ -122,16 +146,16 @@ export default class GoTrueClient {
|
|
|
122
146
|
storeSession?: boolean;
|
|
123
147
|
}): Promise<{
|
|
124
148
|
data: Session | null;
|
|
125
|
-
error:
|
|
149
|
+
error: ApiError | null;
|
|
126
150
|
}>;
|
|
127
151
|
/**
|
|
128
|
-
* Inside a browser context, `signOut()` will remove
|
|
152
|
+
* Inside a browser context, `signOut()` will remove the logged in user from the browser session
|
|
129
153
|
* and log them out - removing all items from localstorage and then trigger a "SIGNED_OUT" event.
|
|
130
154
|
*
|
|
131
155
|
* For server-side management, you can disable sessions by passing a JWT through to `auth.api.signOut(JWT: string)`
|
|
132
156
|
*/
|
|
133
157
|
signOut(): Promise<{
|
|
134
|
-
error:
|
|
158
|
+
error: ApiError | null;
|
|
135
159
|
}>;
|
|
136
160
|
/**
|
|
137
161
|
* Receive a notification every time an auth event happens.
|
|
@@ -139,9 +163,10 @@ export default class GoTrueClient {
|
|
|
139
163
|
*/
|
|
140
164
|
onAuthStateChange(callback: (event: AuthChangeEvent, session: Session | null) => void): {
|
|
141
165
|
data: Subscription | null;
|
|
142
|
-
error:
|
|
166
|
+
error: ApiError | null;
|
|
143
167
|
};
|
|
144
168
|
private _handleEmailSignIn;
|
|
169
|
+
private _handlePhoneSignIn;
|
|
145
170
|
private _handleProviderSignIn;
|
|
146
171
|
/**
|
|
147
172
|
* Attempts to get the session from LocalStorage
|
|
@@ -168,4 +193,5 @@ export default class GoTrueClient {
|
|
|
168
193
|
*/
|
|
169
194
|
private _startAutoRefreshToken;
|
|
170
195
|
}
|
|
196
|
+
export {};
|
|
171
197
|
//# sourceMappingURL=GoTrueClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoTrueClient.d.ts","sourceRoot":"","sources":["../../src/GoTrueClient.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"GoTrueClient.d.ts","sourceRoot":"","sources":["../../src/GoTrueClient.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAGjD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,cAAc,EACd,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