Skip to content

Commit

Permalink
fix(admin): select in query to include password
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopanidis committed Sep 22, 2022
1 parent 7c49340 commit 8fd20e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/admin/src/routes/ChangePassword.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function changePasswordRoute() {
const { oldPassword, newPassword } = req.params!;
const admin = await Admin.getInstance().findOne(
{ _id: req.context!.admin },
'password',
'+password',
);
if (!admin) {
throw ConduitError.notFound('Authenticated admin no longer exists');
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/src/routes/Login.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function getLoginRoute() {
);
}

const admin = await Admin.getInstance().findOne({ username }, 'password');
const admin = await Admin.getInstance().findOne({ username }, '+password');
if (isNil(admin)) {
throw new ConduitError('UNAUTHORIZED', 401, 'Invalid username/password');
}
Expand Down

0 comments on commit 8fd20e0

Please sign in to comment.