Class: Warden::JWTAuth::Interfaces::User

Inherits:
Object
  • Object
show all
Defined in:
lib/warden/jwt_auth/interfaces.rb

Overview

An user

Instance Method Summary collapse

Instance Method Details

#jwt_payloadHash

Allows adding extra claims to be encoded within the payload

Returns:

  • (Hash)

    claims to be merged with defaults



31
32
33
# File 'lib/warden/jwt_auth/interfaces.rb', line 31

def jwt_payload
  {}
end

#jwt_subject#to_s

What will be encoded as ‘sub` claim. It must respond to `#to_s`.

Returns:

  • (#to_s)

    ‘sub` claim

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/warden/jwt_auth/interfaces.rb', line 24

def jwt_subject
  raise NotImplementedError
end

#on_jwt_dispatch(_token, _payload) ⇒ Object

Does something just after a JWT for the user has been dispatched.

Parameters:

  • _token (String)
  • _payload (Hash)

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/warden/jwt_auth/interfaces.rb', line 39

def on_jwt_dispatch(_token, _payload)
  raise NotImplementedError
end