mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-03-21 17:44:49 -05:00
chore: add better logging to login and register routes
Some checks are pending
Build and Publish Docker Image / build-publish (push) Waiting to run
Some checks are pending
Build and Publish Docker Image / build-publish (push) Waiting to run
This commit is contained in:
parent
008a517947
commit
dc5b885e0f
|
|
@ -4,6 +4,7 @@ import { getPNIDByUsername, getPNIDByAPIRefreshToken } from '@/database';
|
|||
import { nintendoPasswordHash, generateOAuthTokens} from '@/util';
|
||||
import { HydratedPNIDDocument } from '@/types/mongoose/pnid';
|
||||
import { SystemType } from '@/types/common/token';
|
||||
import { LOG_ERROR } from '@/logger';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
|
|
@ -118,7 +119,10 @@ router.post('/', async (request: express.Request, response: express.Response): P
|
|||
expires_in: tokenGeneration.expiresInSecs.access,
|
||||
refresh_token: tokenGeneration.refreshToken
|
||||
});
|
||||
} catch {
|
||||
} catch (error: any) {
|
||||
LOG_ERROR('/v1/login - token generation: ' + error);
|
||||
if (error.stack) console.error(error.stack);
|
||||
|
||||
response.status(500).json({
|
||||
app: 'api',
|
||||
status: 500,
|
||||
|
|
|
|||
|
|
@ -376,7 +376,10 @@ router.post('/', async (request: express.Request, response: express.Response): P
|
|||
expires_in: tokenGeneration.expiresInSecs.access,
|
||||
refresh_token: tokenGeneration.refreshToken
|
||||
});
|
||||
} catch {
|
||||
} catch (error: any) {
|
||||
LOG_ERROR('/v1/register - token generation: ' + error);
|
||||
if (error.stack) console.error(error.stack);
|
||||
|
||||
response.status(500).json({
|
||||
app: 'api',
|
||||
status: 500,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user