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

Commit

Permalink
fix: invalid deprecation fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-tux committed Apr 28, 2022
1 parent edfd3f7 commit 17912f7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/routes/reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ export async function checkCode(
.catch(() => Promise.reject(config.apiErrors.reset.resetFailed));
}

function setSessionKey(req: express.Request, key: string): void {
req.headers.authorization = config.global.authScheme + " " + key;
}

/**
* Route that will reset the password when the code and password are valid.
* Use route `/reset/:id` with a 'POST' request with body of form
Expand Down Expand Up @@ -168,6 +172,10 @@ export async function resetPassword(
Promise.resolve({ sessionkey: key.session_key })
);
})
.then((v) => {
setSessionKey(req, v.sessionkey);
return v;
})
.catch(() =>
Promise.reject(config.apiErrors.reset.resetFailed)
);
Expand Down

0 comments on commit 17912f7

Please sign in to comment.