fix(core): Use JWT as reset password token (#6714)

* use jwt to reset password

* increase expiration time to 1d

* drop user id query string

* refactor

* use service instead of package in tests

* sqlite migration

* postgres migration

* mysql migration

* remove unused properties

* remove userId from FE

* fix test for users.api

* move migration to the common folder

* move type assertion to the jwt.service

* Add jwt secret as a readonly property

* use signData instead of sign in user.controller

* remove base class

* remove base class

* add tests
This commit is contained in:
Ricardo Espinoza
2023-07-24 17:40:17 -04:00
committed by GitHub
parent c2511a829c
commit 89f44021b9
19 changed files with 209 additions and 146 deletions

View File

@@ -226,15 +226,11 @@ export const useUsersStore = defineStore(STORES.USERS, {
const rootStore = useRootStore();
await sendForgotPasswordEmail(rootStore.getRestApiContext, params);
},
async validatePasswordToken(params: { token: string; userId: string }): Promise<void> {
async validatePasswordToken(params: { token: string }): Promise<void> {
const rootStore = useRootStore();
await validatePasswordToken(rootStore.getRestApiContext, params);
},
async changePassword(params: {
token: string;
password: string;
userId: string;
}): Promise<void> {
async changePassword(params: { token: string; password: string }): Promise<void> {
const rootStore = useRootStore();
await changePassword(rootStore.getRestApiContext, params);
},