diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5f9d7e7c4..fc1bb772f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -50,12 +50,20 @@ module ApplicationHelper def available_sign_up_path if closed_registrations? || omniauth_only? - 'https://joinmastodon.org/#getting-started' + ENV.fetch('SSO_ACCOUNT_SIGN_UP', 'https://joinmastodon.org/#getting-started') else ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_path) end end + def available_reset_password_path + ENV.fetch('SSO_ACCOUNT_RESET_PASSWORD', new_user_password_path) + end + + def available_resend_confirmation_path + ENV.fetch('SSO_ACCOUNT_RESEND_CONFIRMATION', new_user_confirmation_path) + end + def omniauth_only? ENV['OMNIAUTH_ONLY'] == 'true' end diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml index 757ef0a09..89efa1e78 100644 --- a/app/views/auth/shared/_links.html.haml +++ b/app/views/auth/shared/_links.html.haml @@ -9,10 +9,10 @@ %li= link_to t('auth.register'), available_sign_up_path - if controller_name != 'passwords' && controller_name != 'registrations' - %li= link_to t('auth.forgot_password'), new_user_password_path + %li= link_to t('auth.forgot_password'), available_reset_password_path - if controller_name != 'confirmations' && (!user_signed_in? || !current_user.confirmed? || current_user.unconfirmed_email.present?) - %li= link_to t('auth.didnt_get_confirmation'), new_user_confirmation_path + %li= link_to t('auth.didnt_get_confirmation'), available_resend_confirmation_path - if user_signed_in? %li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }