Module: JWTPayload

Included in:
Launchpad::API::V2::Admin::BaseController, Launchpad::API::V2::Private::BaseController
Defined in:
app/controllers/concerns/jwt_payload.rb

Instance Method Summary collapse

Instance Method Details

#emailObject



12
13
14
# File 'app/controllers/concerns/jwt_payload.rb', line 12

def email
  jwt_payload[:email]
end

#jwt_payloadObject



4
5
6
# File 'app/controllers/concerns/jwt_payload.rb', line 4

def jwt_payload
  @jwt_payload ||= request.env.fetch("jwt.payload", {}).symbolize_keys
end

#roleObject



16
17
18
# File 'app/controllers/concerns/jwt_payload.rb', line 16

def role
  jwt_payload[:role]
end

#uidObject



8
9
10
# File 'app/controllers/concerns/jwt_payload.rb', line 8

def uid
  jwt_payload[:uid]
end