Class: Motor::AuthTokensController

Inherits:
ApiBaseController show all
Defined in:
app/controllers/motor/auth_tokens_controller.rb

Constant Summary collapse

GENERIC_TOKEN_TTL =
2.hours

Instance Method Summary collapse

Methods included from CurrentAbility

#current_ability

Methods included from CurrentUserMethod

#current_user

Instance Method Details

#createObject


9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/motor/auth_tokens_controller.rb', line 9

def create
  return render json: {} unless current_user

  if defined?(Devise::JWT)
    respond_with_devise_jwt
  elsif defined?(JWT)
    respond_with_generic_jwt
  else
    render json: {}
  end
end