Exception: StandardId::SocialLinkError

Inherits:
OAuthError
  • Object
show all
Defined in:
lib/standard_id/errors.rb

Overview

Social login errors NOTE: email and provider_name are exposed as reader attributes for host apps to build custom error responses. If you report exceptions to an error tracker (Sentry, etc.), be aware these attributes contain PII.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email:, provider_name:) ⇒ SocialLinkError

Returns a new instance of SocialLinkError.



86
87
88
89
90
# File 'lib/standard_id/errors.rb', line 86

def initialize(email:, provider_name:)
  @email = email
  @provider_name = provider_name
  super("This email is already associated with an account. Please sign in first to link this provider.")
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



84
85
86
# File 'lib/standard_id/errors.rb', line 84

def email
  @email
end

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



84
85
86
# File 'lib/standard_id/errors.rb', line 84

def provider_name
  @provider_name
end

Instance Method Details

#http_statusObject



94
# File 'lib/standard_id/errors.rb', line 94

def http_status = :forbidden

#oauth_error_codeObject

Uses standard OAuth :access_denied code since account_link_required is non-standard



93
# File 'lib/standard_id/errors.rb', line 93

def oauth_error_code = :access_denied