Exception: Supabase::Rails::AuthError
- Inherits:
-
StandardError
- Object
- StandardError
- Supabase::Rails::AuthError
- Defined in:
- lib/supabase/rails/errors.rb
Constant Summary collapse
- AUTH_GENERIC_ERROR =
"AUTH_ERROR"- INVALID_CREDENTIALS =
"INVALID_CREDENTIALS"- CREATE_SUPABASE_CLIENT_ERROR =
"CREATE_SUPABASE_CLIENT_ERROR"- REFRESH_UNAVAILABLE =
"REFRESH_UNAVAILABLE"- PKCE_ERROR =
"PKCE_ERROR"- WEAK_PASSWORD =
"WEAK_PASSWORD"- SESSION_MISSING =
"SESSION_MISSING"- INVALID_REDIRECT =
"INVALID_REDIRECT"- AUTH_API_ERROR =
"AUTH_API_ERROR"- AUTH_UPSTREAM_ERROR =
"AUTH_UPSTREAM_ERROR"- AUTH_RETRYABLE =
"AUTH_RETRYABLE"
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
- .create_supabase_client_error ⇒ Object
- .invalid_credentials ⇒ Object
- .invalid_redirect(uri) ⇒ Object
- .pkce_missing_verifier ⇒ Object
- .refresh_unavailable ⇒ Object
- .session_missing ⇒ Object
Instance Method Summary collapse
-
#initialize(message, code = AUTH_GENERIC_ERROR, status = 401) ⇒ AuthError
constructor
A new instance of AuthError.
Constructor Details
#initialize(message, code = AUTH_GENERIC_ERROR, status = 401) ⇒ AuthError
Returns a new instance of AuthError.
97 98 99 100 101 |
# File 'lib/supabase/rails/errors.rb', line 97 def initialize(, code = AUTH_GENERIC_ERROR, status = 401) super() @code = code @status = status end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
95 96 97 |
# File 'lib/supabase/rails/errors.rb', line 95 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
95 96 97 |
# File 'lib/supabase/rails/errors.rb', line 95 def status @status end |
Class Method Details
.create_supabase_client_error ⇒ Object
107 108 109 |
# File 'lib/supabase/rails/errors.rb', line 107 def self.create_supabase_client_error new("Failed to create Supabase client", CREATE_SUPABASE_CLIENT_ERROR, 500) end |
.invalid_credentials ⇒ Object
103 104 105 |
# File 'lib/supabase/rails/errors.rb', line 103 def self.invalid_credentials new("Invalid credentials", INVALID_CREDENTIALS, 401) end |
.invalid_redirect(uri) ⇒ Object
127 128 129 130 131 132 133 |
# File 'lib/supabase/rails/errors.rb', line 127 def self.invalid_redirect(uri) new( %(redirect target #{uri.inspect} is not in `config.supabase.allowed_redirect_origins`), INVALID_REDIRECT, 400 ) end |
.pkce_missing_verifier ⇒ Object
119 120 121 122 123 124 125 |
# File 'lib/supabase/rails/errors.rb', line 119 def self.pkce_missing_verifier new( "PKCE verifier missing or expired. Restart the OAuth flow.", PKCE_ERROR, 400 ) end |
.refresh_unavailable ⇒ Object
111 112 113 114 115 116 117 |
# File 'lib/supabase/rails/errors.rb', line 111 def self.refresh_unavailable new( "Supabase Auth is temporarily unavailable. Please try again.", REFRESH_UNAVAILABLE, 503 ) end |
.session_missing ⇒ Object
135 136 137 138 139 140 141 |
# File 'lib/supabase/rails/errors.rb', line 135 def self.session_missing new( "Authentication required. No active Supabase session.", SESSION_MISSING, 401 ) end |