Skip to content
This repository has been archived by the owner on May 12, 2022. It is now read-only.

Commit

Permalink
implemented resetUserPassword from easybasejs
Browse files Browse the repository at this point in the history
  • Loading branch information
dilan-dio4 committed May 9, 2021
1 parent 57fe049 commit abad931
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/EasybaseContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const c: ContextValue = {
getUserAttributes: async() => ({}) as Record<string, string>,
isUserSignedIn: () => false,
setUserAttribute: async (_: string, _2: string) => ({}) as StatusResponse,
resetUserPassword: async (_: string) => ({}) as StatusResponse,
signIn: async (_: string, _2: string) => ({}) as StatusResponse,
signOut: () => {},
signUp: async (_: string, _2: string, _3?: Record<string, string>) => ({}) as StatusResponse,
Expand Down
2 changes: 2 additions & 0 deletions src/EasybaseProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const {
signUp,
setUserAttribute,
getUserAttributes,
resetUserPassword,
signIn,
signOut
} = authFactory(g);
Expand Down Expand Up @@ -559,6 +560,7 @@ const EasybaseProvider = ({ children, ebconfig, options }: EasybaseProviderProps
signUp,
setUserAttribute,
getUserAttributes,
resetUserPassword,
onSignIn,
db,
dbEventListener,
Expand Down
7 changes: 7 additions & 0 deletions src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ export interface ContextValue {
* @return {Promise<StatusResponse>} Promise<StatusResponse>
*/
setUserAttribute(key: string, value: string): Promise<StatusResponse>;
/**
* Reset the currently signed-in user's password to a new string.
* @async
* @param {string} newPassword New user password
* @return {Promise<StatusResponse>} Promise<StatusResponse>
*/
resetUserPassword(newPassword: string): Promise<StatusResponse>;
/**
* Sign in a user that already exists for a project. This will save authentication tokens to a user's browser so that
* they will be automatically authenticated when they return to the application. These authentcation tokens will become invalid
Expand Down

0 comments on commit abad931

Please sign in to comment.