Module: TinyPassport::HttpAuthable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/tiny_passport/http_authable.rb
Instance Method Summary collapse
-
#authcenter ⇒ Object
authcenter.create_session(login_record) authcenter.clear_session.
-
#authcenter_account_no_required! ⇒ Object
用户不能登录,如果登录了,提示退出.
- #authcenter_account_required! ⇒ Object
- #current_account ⇒ Object
Instance Method Details
#authcenter ⇒ Object
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 => , :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 authcenter_account_no_required! if authcenter.account_signed_in? 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 authcenter_account_required! unless authcenter.account_signed_in? raise ::TinyPassport::.new end end |
#current_account ⇒ Object
26 27 28 |
# File 'lib/tiny_passport/http_authable.rb', line 26 def current_account self.authcenter.current_account end |