@leisuresaas/react 0.1.1 → 0.1.2-dev.1
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/package.json +1 -1
- package/src/auth.ts +12 -0
- package/src/index.ts +2 -0
package/package.json
CHANGED
package/src/auth.ts
CHANGED
|
@@ -124,6 +124,18 @@ export async function requestProductEmailVerification(
|
|
|
124
124
|
await publicAuthRequest(ctx, "/email-verification", { email: input.email, locale: input.locale ?? "" });
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
export async function confirmProductEmailVerification(ctx: PublicAuthContext, token: string): Promise<ProductAuthTokens> {
|
|
128
|
+
const resp = await publicAuthRequest<TokenJSON>(ctx, "/email-verification/confirm", { token });
|
|
129
|
+
return tokensFromJSON(resp);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export async function confirmProductPasswordReset(
|
|
133
|
+
ctx: PublicAuthContext,
|
|
134
|
+
input: { token: string; newPassword: string },
|
|
135
|
+
): Promise<void> {
|
|
136
|
+
await publicAuthRequest(ctx, "/password-reset/confirm", { token: input.token, new_password: input.newPassword });
|
|
137
|
+
}
|
|
138
|
+
|
|
127
139
|
export async function changeProductPassword(
|
|
128
140
|
ctx: PublicAuthContext,
|
|
129
141
|
accessToken: string,
|
package/src/index.ts
CHANGED