mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 08:09:13 -05:00
34 lines
740 B
Ruby
34 lines
740 B
Ruby
module Auth; end
|
|
class Auth::CurrentUserProvider
|
|
|
|
# do all current user initialization here
|
|
def initialize(env)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
# our current user, return nil if none is found
|
|
def current_user
|
|
raise NotImplementedError
|
|
end
|
|
|
|
# log on a user and set cookies and session etc.
|
|
def log_on_user(user,session,cookies)
|
|
raise NotImplementedError
|
|
end
|
|
|
|
# api has special rights return true if api was detected
|
|
def is_api?
|
|
raise NotImplementedError
|
|
end
|
|
|
|
# we may need to know very early on in the middleware if an auth token
|
|
# exists, to optimise caching
|
|
def has_auth_cookie?
|
|
raise NotImplementedError
|
|
end
|
|
|
|
|
|
def log_off_user(session, cookies)
|
|
raise NotImplementedError
|
|
end
|
|
end
|