Module: GorillaProxy::CurrentTokenHelper
- Included in:
- ApplicationController
- Defined in:
- app/helpers/gorilla_proxy/current_token_helper.rb
Instance Method Summary collapse
- #current_token ⇒ Object
- #forget_token! ⇒ Object
- #gorilla_token ⇒ Object
- #remember_token!(token) ⇒ Object
Instance Method Details
#current_token ⇒ Object
21 22 23 |
# File 'app/helpers/gorilla_proxy/current_token_helper.rb', line 21 def current_token @current_token ||= GorillaProxy::Token.new(gorilla_token) end |
#forget_token! ⇒ Object
16 17 18 19 |
# File 'app/helpers/gorilla_proxy/current_token_helper.rb', line 16 def forget_token! .delete(token_session_key) @current_token = nil end |
#gorilla_token ⇒ Object
4 5 6 |
# File 'app/helpers/gorilla_proxy/current_token_helper.rb', line 4 def gorilla_token .signed[token_session_key] end |
#remember_token!(token) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/helpers/gorilla_proxy/current_token_helper.rb', line 8 def remember_token!(token) @current_token = nil .signed[token_session_key] = { value: token, expires: 1.year.from_now } end |