mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-07-31 00:26:11 -05:00
user not found api error
This commit is contained in:
parent
cf44ee7888
commit
0a7f64fea5
|
|
@ -50,6 +50,14 @@ router.post('/', async (request, response) => {
|
|||
let pnid;
|
||||
if (grant_type === 'password') {
|
||||
pnid = await database.getUserByUsername(username);
|
||||
if (!pnid) {
|
||||
return response.status(400).json({
|
||||
app: 'api',
|
||||
status: 400,
|
||||
error: 'User not found'
|
||||
});
|
||||
}
|
||||
|
||||
const hashedPassword = util.nintendoPasswordHash(password, pnid.get('pid'));
|
||||
|
||||
if (!pnid || !bcrypt.compareSync(hashedPassword, pnid.password)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user