Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Caballerog/0d85b69b66a2bfe803a9028749583215 to your computer and use it in GitHub Desktop.
Save Caballerog/0d85b69b66a2bfe803a9028749583215 to your computer and use it in GitHub Desktop.
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