Created
May 2, 2021 14:15
-
-
Save Caballerog/0d85b69b66a2bfe803a9028749583215 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class RoleMiddleware extends Middleware { | |
public execute({ email, password }: User): boolean { | |
if (email === USERS.ADMIN.email) { | |
console.log("Hello, admin!"); | |
return true; | |
} | |
console.log("Hello, user!"); | |
return this.checkNext({ email, password }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment