diff --git a/api.planx.uk/modules/auth/middleware.ts b/api.planx.uk/modules/auth/middleware.ts index ee11d02c86..0548197f63 100644 --- a/api.planx.uk/modules/auth/middleware.ts +++ b/api.planx.uk/modules/auth/middleware.ts @@ -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, diff --git a/api.planx.uk/modules/auth/service.ts b/api.planx.uk/modules/auth/service.ts index 574d625dc2..1ee77b0afa 100644 --- a/api.planx.uk/modules/auth/service.ts +++ b/api.planx.uk/modules/auth/service.ts @@ -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(), }; diff --git a/api.planx.uk/modules/auth/strategy/google.ts b/api.planx.uk/modules/auth/strategy/google.ts index 10212ba2d5..8461cfd670 100644 --- a/api.planx.uk/modules/auth/strategy/google.ts +++ b/api.planx.uk/modules/auth/strategy/google.ts @@ -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); }