fix(server): change password with token should be public (#7855)

This commit is contained in:
forehalo
2024-08-14 03:34:35 +00:00
parent 7afba6b8b5
commit 0ba516866f
12 changed files with 78 additions and 114 deletions

View File

@@ -129,26 +129,23 @@ export async function sendSetPasswordEmail(
export async function changePassword(
app: INestApplication,
userToken: string,
userId: string,
token: string,
password: string
): Promise<string> {
const res = await request(app.getHttpServer())
.post(gql)
.auth(userToken, { type: 'bearer' })
.set({ 'x-request-id': 'test', 'x-operation-name': 'test' })
.send({
query: `
mutation changePassword($token: String!, $password: String!) {
changePassword(token: $token, newPassword: $password) {
id
}
mutation changePassword($token: String!, $userId: String!, $password: String!) {
changePassword(token: $token, userId: $userId, newPassword: $password)
}
`,
variables: { token, password },
variables: { token, password, userId },
})
.expect(200);
return res.body.data.changePassword.id;
return res.body.data.changePassword;
}
export async function sendVerifyChangeEmail(