Module: UserHelpers
- Included in:
- BaseController, RTCPController
- Defined in:
- app/base/helpers/user.rb
Instance Method Summary collapse
- #authorization_token ⇒ Object
- #authorized_user ⇒ Object
- #authorized_user! ⇒ Object
- #authorized_user_id ⇒ Object
- #authorized_user_id! ⇒ Object
Instance Method Details
#authorization_token ⇒ Object
21 22 23 |
# File 'app/base/helpers/user.rb', line 21 def params[:__authorization_token__] || [:__authorization_token__] end |
#authorized_user ⇒ Object
3 4 5 6 |
# File 'app/base/helpers/user.rb', line 3 def return unless # fetch user, e.g. User.find_by(authorization_token: authorization_token) end |
#authorized_user! ⇒ Object
8 9 10 |
# File 'app/base/helpers/user.rb', line 8 def || error(401) end |
#authorized_user_id ⇒ Object
12 13 14 15 |
# File 'app/base/helpers/user.rb', line 12 def return unless # fetch user, e.g. User.where(authorization_token: authorization_token).pluck(:id)[0] end |
#authorized_user_id! ⇒ Object
17 18 19 |
# File 'app/base/helpers/user.rb', line 17 def || error(401) end |