2013-08-23 02:20:43 -04:00
|
|
|
# this class is used by the user and omniauth controllers, it controls how
|
2013-08-25 21:04:16 -04:00
|
|
|
# an authentication system interacts with our database and middleware
|
2013-08-23 02:20:43 -04:00
|
|
|
|
|
|
|
class Auth::Authenticator
|
|
|
|
def after_authenticate(auth_options)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
|
|
|
|
2013-09-24 09:17:57 -04:00
|
|
|
# can be used to hook in after the authentication process
|
2013-08-23 02:20:43 -04:00
|
|
|
# to ensure records exist for the provider in the db
|
|
|
|
# this MUST be implemented for authenticators that do not
|
|
|
|
# trust email
|
|
|
|
def after_create_account(user, auth)
|
|
|
|
# not required
|
|
|
|
end
|
|
|
|
|
2013-08-25 21:04:16 -04:00
|
|
|
# hook used for registering omniauth middleware,
|
|
|
|
# without this we can not authenticate
|
|
|
|
def register_middleware(omniauth)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2013-08-23 02:20:43 -04:00
|
|
|
end
|