introduce reset token, comment isAuthorized

This commit is contained in:
Moriz Wahl 2022-03-14 14:15:24 +01:00
parent 095e6603ab
commit 35cc38ba7c
2 changed files with 7 additions and 1 deletions

View File

@ -14,6 +14,12 @@ const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {
context.role = ROLE_UNAUTHORIZED // unauthorized user
// moriz: I think it is better to check the INALIENABLE_RIGHTS here
/*
if ((<RIGHTS[]>rights).reduce(
(acc, right) => acc && INALIENABLE_RIGHTS.includes(right),
true,
)) return true
*/
// Do we have a token?
if (context.token) {

View File

@ -373,7 +373,7 @@ describe('UserResolver', () => {
describe('user is in database and wrong password', () => {
beforeAll(async () => {
// resetToken()
resetToken()
await createUser(mutate, {
email: 'peter@lustig.de',
firstName: 'Peter',