Module: TinyPassport::HttpAuthable

Extended by:
ActiveSupport::Concern
Defined in:
lib/tiny_passport/http_authable.rb

Instance Method Summary collapse

Instance Method Details

#authcenterObject

authcenter.create_session(login_record) authcenter.clear_session



16
17
18
19
20
21
22
23
24
# File 'lib/tiny_passport/http_authable.rb', line 16

def authcenter
  @authcenter ||= ::TinyPassport::HttpAuthcenter.new(
    :request  => request,
    :response => response,
    :cookies  => cookies,
    :session  => session,
    :url_authcenter => url_authcenter
  )
end

#authcenter_account_no_required!Object

用户不能登录,如果登录了,提示退出



37
38
39
40
41
# File 'lib/tiny_passport/http_authable.rb', line 37

def 
  if authcenter.
    raise ::TinyPassport::AlertAuthorizedError.new
  end
end

#authcenter_account_required!Object



30
31
32
33
34
# File 'lib/tiny_passport/http_authable.rb', line 30

def 
  unless authcenter.
    raise ::TinyPassport::UnauthorizedError.new
  end
end

#current_accountObject



26
27
28
# File 'lib/tiny_passport/http_authable.rb', line 26

def 
  self.authcenter.
end