Class: Stytch::MethodOptions::Authorization

Inherits:
Object
  • Object
show all
Defined in:
lib/stytch/method_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session_token: nil, session_jwt: nil) ⇒ Authorization

Returns a new instance of Authorization.



9
10
11
12
# File 'lib/stytch/method_options.rb', line 9

def initialize(session_token: nil, session_jwt: nil)
  @session_token = session_token
  @session_jwt = session_jwt
end

Instance Attribute Details

#session_jwtObject

The JSON Web Token (JWT) for a given Stytch Session.



7
8
9
# File 'lib/stytch/method_options.rb', line 7

def session_jwt
  @session_jwt
end

#session_tokenObject

A secret token for a given Stytch Session.



5
6
7
# File 'lib/stytch/method_options.rb', line 5

def session_token
  @session_token
end

Instance Method Details

#to_headersObject



14
15
16
17
18
19
# File 'lib/stytch/method_options.rb', line 14

def to_headers
  headers = {}
  headers['X-Stytch-Member-Session'] = session_token if session_token
  headers['X-Stytch-Member-SessionJWT'] = session_jwt if session_jwt
  headers
end