mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
Catch error and provide message
This commit is contained in:
@@ -4,6 +4,9 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
def openid_connect
|
||||
OidcAccount.link(spree_current_user, request.env["omniauth.auth"])
|
||||
|
||||
redirect_to admin_oidc_settings_path
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
flash[:error] = t("devise.oidc.record_not_unique", uid: request.env["omniauth.auth"].uid)
|
||||
redirect_to admin_oidc_settings_path
|
||||
end
|
||||
|
||||
|
||||
@@ -321,6 +321,7 @@ en:
|
||||
send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes."
|
||||
oidc:
|
||||
failure: "Could not sign in: %{error}"
|
||||
record_not_unique: "%{uid} is already associated with another account"
|
||||
home_page_alert_html: "Home page alert HTML"
|
||||
hub_signup_case_studies_html: "Hub signup case studies HTML"
|
||||
hub_signup_detail_html: "Hub signup detail HTML"
|
||||
|
||||
Reference in New Issue
Block a user