Class: Supabase::Auth::Types::AuthMFAVerifyResponse

Inherits:
Struct
  • Object
show all
Defined in:
lib/supabase/auth/types.rb

Overview

MFA Verify response (matches Python: access_token, token_type, expires_in, refresh_token, user)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token

Returns:

  • (Object)

    the current value of access_token



337
338
339
# File 'lib/supabase/auth/types.rb', line 337

def access_token
  @access_token
end

#expires_inObject

Returns the value of attribute expires_in

Returns:

  • (Object)

    the current value of expires_in



337
338
339
# File 'lib/supabase/auth/types.rb', line 337

def expires_in
  @expires_in
end

#refresh_tokenObject

Returns the value of attribute refresh_token

Returns:

  • (Object)

    the current value of refresh_token



337
338
339
# File 'lib/supabase/auth/types.rb', line 337

def refresh_token
  @refresh_token
end

#token_typeObject

Returns the value of attribute token_type

Returns:

  • (Object)

    the current value of token_type



337
338
339
# File 'lib/supabase/auth/types.rb', line 337

def token_type
  @token_type
end

#userObject

Returns the value of attribute user

Returns:

  • (Object)

    the current value of user



337
338
339
# File 'lib/supabase/auth/types.rb', line 337

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object



345
346
347
348
349
350
351
352
353
354
355
# File 'lib/supabase/auth/types.rb', line 345

def self.from_hash(hash)
  return nil if hash.nil?

  new(
    access_token: hash["access_token"] || hash[:access_token],
    token_type: hash["token_type"] || hash[:token_type],
    expires_in: hash["expires_in"] || hash[:expires_in],
    refresh_token: hash["refresh_token"] || hash[:refresh_token],
    user: User.from_hash(hash["user"] || hash[:user])
  )
end