Module: Clerk::Helpers::ViewAndController
- Defined in:
- lib/clerk/helpers.rb
Instance Method Summary collapse
Instance Method Details
#account_signed_in? ⇒ Boolean
22 23 24 |
# File 'lib/clerk/helpers.rb', line 22 def account_signed_in? !current_account.nil? end |
#current_account ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/clerk/helpers.rb', line 26 def current_account @clerk_current_account ||= begin if [:clerk_session] SessionToken.find_account( cookie: [:clerk_session] ) elsif request.headers['Authorization'] token = request.headers['Authorization'].slice(7..-1) SessionToken.find_account( cookie: token ) else nil end end end |