Class: Rhino::AuthHooks

Inherits:
Object
  • Object
show all
Defined in:
lib/rhino/auth_hooks.rb

Overview

Base class for per-group auth lifecycle hooks. A group’s optional ‘hooks:` class may subclass this (or simply respond to the event methods) and override any of the events; each defaults to a no-op.

Each event receives the affected user and a context hash:

{ user:, route_group:, organization:, token:, request: }

A hook rejects an action by raising Rhino::AuthRejected (optionally with a status). For token-issuing actions (login/register) the controller revokes the just-issued token and returns the status; for the others it returns the status without side effects.

See GROUP_AUTH_DESIGN.md §7.

Instance Method Summary collapse

Instance Method Details

#after_login(user, context = {}) ⇒ Object



18
# File 'lib/rhino/auth_hooks.rb', line 18

def (user, context = {}); end

#after_logout(user, context = {}) ⇒ Object



20
# File 'lib/rhino/auth_hooks.rb', line 20

def after_logout(user, context = {}); end

#after_password_recover(user, context = {}) ⇒ Object



24
# File 'lib/rhino/auth_hooks.rb', line 24

def after_password_recover(user, context = {}); end

#after_password_reset(user, context = {}) ⇒ Object



26
# File 'lib/rhino/auth_hooks.rb', line 26

def after_password_reset(user, context = {}); end

#after_register(user, context = {}) ⇒ Object



22
# File 'lib/rhino/auth_hooks.rb', line 22

def after_register(user, context = {}); end