Compare commits
2 Commits
2dccaca132
...
b65bd12c8a
Author | SHA1 | Date |
---|---|---|
Derrick Hammer | b65bd12c8a | |
Derrick Hammer | 8ca46c6f18 |
|
@ -31,6 +31,11 @@ export type Identity = {
|
|||
email: string;
|
||||
}
|
||||
|
||||
export type UpdatePasswordFormRequest = {
|
||||
currentPassword: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
|
||||
const maybeSetupAuth = (): void => {
|
||||
const jwt = sdk.account().jwtToken;
|
||||
|
@ -95,8 +100,26 @@ export const createPortalAuthProvider = (sdk: Sdk): AuthProvider => {
|
|||
return {success: true};
|
||||
},
|
||||
|
||||
async updatePassword(params: any): Promise<AuthActionResponse> {
|
||||
return { success: true };
|
||||
async updatePassword(params: UpdatePasswordFormRequest): Promise<AuthActionResponse> {
|
||||
maybeSetupAuth();
|
||||
const ret = await sdk.account().updatePassword(params.currentPassword, params.newPassword);
|
||||
|
||||
if (ret) {
|
||||
if (ret instanceof Error) {
|
||||
return {
|
||||
success: false,
|
||||
error: ret
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
success: false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
async getPermissions(params?: Record<string, any>): Promise<AuthActionResponse> {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"@conform-to/react": "^1.0.2",
|
||||
"@conform-to/zod": "^1.0.2",
|
||||
"@fontsource-variable/manrope": "^5.0.19",
|
||||
"@lumeweb/portal-sdk": "0.0.0-20240319120038",
|
||||
"@lumeweb/portal-sdk": "0.0.0-20240319140708",
|
||||
"@radix-ui/react-avatar": "^1.0.4",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-dialog": "^1.0.5",
|
||||
|
|
Loading…
Reference in New Issue