Skip to content

Commit

Permalink
fix: login/pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Oct 5, 2023
1 parent 056a594 commit d2d53ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export async function loginAccount(request: Request, response: Response, next: N

// If admin check that the user has any permissions
if (admin && (!user.permissions || user.permissions.length === 0)) {
return forbidden(response, ResponseError.LoginNotAllowed);
return forbidden(response, ResponseError.NotAdmin);
}

const token = generateToken(user);
Expand Down
2 changes: 1 addition & 1 deletion tests/admin/auth/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('POST /admin/auth/login', () => {
login: user.email,
password,
})
.expect(403, { error: Error.LoginNotAllowed });
.expect(403, { error: Error.NotAdmin });
await database.user.update({
where: {
id: user.id,
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/pdf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Tests the PDF utils', () => {
});

let placeId = 0;
for (const tournamentId of ['lol', 'ssbu', 'csgo', 'rl', 'osu', 'tft', 'open', 'pokemon']) {
for (const tournamentId of ['lol', 'ssbu', 'cs2', 'rl', 'osu', 'tft', 'open', 'pokemon']) {
it(`should generate a PDF ticket for ${tournamentId}`, async () => {
// Create a fake user and add it in a random team
const team = await createFakeTeam({ tournament: tournamentId as string });
Expand Down

0 comments on commit d2d53ba

Please sign in to comment.