@quatrain/auth-supabase 1.2.5 → 1.2.6
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.
|
@@ -79,4 +79,11 @@ export declare class SupabaseAuthAdapter extends AbstractAuthAdapter {
|
|
|
79
79
|
* @returns Resolved updated user wrapper.
|
|
80
80
|
*/
|
|
81
81
|
setCustomUserClaims(id: string, claims: any): Promise<any>;
|
|
82
|
+
/**
|
|
83
|
+
* Initiates password recovery/reset process for a user.
|
|
84
|
+
*
|
|
85
|
+
* @param email - The user email.
|
|
86
|
+
* @param redirectTo - Optional redirect destination.
|
|
87
|
+
*/
|
|
88
|
+
recoverPassword(email: string, redirectTo?: string): Promise<any>;
|
|
82
89
|
}
|
|
@@ -246,5 +246,22 @@ class SupabaseAuthAdapter extends auth_1.AbstractAuthAdapter {
|
|
|
246
246
|
}
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* Initiates password recovery/reset process for a user.
|
|
251
|
+
*
|
|
252
|
+
* @param email - The user email.
|
|
253
|
+
* @param redirectTo - Optional redirect destination.
|
|
254
|
+
*/
|
|
255
|
+
recoverPassword(email, redirectTo) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
+
const { data, error } = yield this._client.auth.resetPasswordForEmail(email, {
|
|
258
|
+
redirectTo,
|
|
259
|
+
});
|
|
260
|
+
if (error) {
|
|
261
|
+
throw new Error(error.message);
|
|
262
|
+
}
|
|
263
|
+
return data;
|
|
264
|
+
});
|
|
265
|
+
}
|
|
249
266
|
}
|
|
250
267
|
exports.SupabaseAuthAdapter = SupabaseAuthAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/auth-supabase",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
},
|
|
20
20
|
"author": "Quatrain Développement SAS <developers@quatrain.com>",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@quatrain/api": "^1.1.
|
|
23
|
-
"@quatrain/auth": "^1.2.
|
|
24
|
-
"@quatrain/backend": "^1.2.
|
|
22
|
+
"@quatrain/api": "^1.1.6",
|
|
23
|
+
"@quatrain/auth": "^1.2.4",
|
|
24
|
+
"@quatrain/backend": "^1.2.13",
|
|
25
25
|
"@supabase/supabase-js": "^2.87.3",
|
|
26
26
|
"node-fetch-native": "^1.6.4"
|
|
27
27
|
},
|
|
@@ -222,4 +222,20 @@ export class SupabaseAuthAdapter extends AbstractAuthAdapter {
|
|
|
222
222
|
return data
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Initiates password recovery/reset process for a user.
|
|
228
|
+
*
|
|
229
|
+
* @param email - The user email.
|
|
230
|
+
* @param redirectTo - Optional redirect destination.
|
|
231
|
+
*/
|
|
232
|
+
async recoverPassword(email: string, redirectTo?: string) {
|
|
233
|
+
const { data, error } = await this._client.auth.resetPasswordForEmail(email, {
|
|
234
|
+
redirectTo,
|
|
235
|
+
})
|
|
236
|
+
if (error) {
|
|
237
|
+
throw new Error(error.message)
|
|
238
|
+
}
|
|
239
|
+
return data
|
|
240
|
+
}
|
|
225
241
|
}
|