Skip to content

Commit

Permalink
chore: Tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Sep 3, 2023
1 parent 18b72a3 commit 58ba9e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion api.planx.uk/modules/auth/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ export const useRoleAuth: UseRoleAuth =

if (!isAuthorised) {
console.error(
`Authentication error: User ${userId} does have have any of the roles ${authRoles} which are required to access ${req.path}`,
`Authentication error: User ${userId} does have have any of the roles [${authRoles.join(
", ",
)}] which are required to access ${req.path}`,
);
return next({
status: 403,
Expand Down
4 changes: 2 additions & 2 deletions api.planx.uk/modules/auth/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export const buildJWT = async (email: string | undefined) => {
const { id } = users[0];

const hasura = {
"x-hasura-allowed-roles": ["admin"],
"x-hasura-default-role": "admin",
"x-hasura-allowed-roles": ["platformAdmin", "public"],
"x-hasura-default-role": "platformAdmin",
"x-hasura-user-id": id.toString(),
};

Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/modules/auth/strategy/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const googleStrategy = new GoogleStrategy(
if (!jwt) {
return done({
status: 404,
message: `User (${email}) not found.Do you need to log in to a different Google Account?`,
message: `User (${email}) not found. Do you need to log in to a different Google Account?`,
} as any);
}

Expand Down

0 comments on commit 58ba9e9

Please sign in to comment.