Make signup/login URLs configurable
Allows instances with LDAP/SSO setup to send users to the correct URLs
This commit is contained in:
parent
6110ef33a0
commit
b916182bc1
@ -50,12 +50,20 @@ module ApplicationHelper
|
|||||||
|
|
||||||
def available_sign_up_path
|
def available_sign_up_path
|
||||||
if closed_registrations? || omniauth_only?
|
if closed_registrations? || omniauth_only?
|
||||||
'https://joinmastodon.org/#getting-started'
|
ENV.fetch('SSO_ACCOUNT_SIGN_UP', 'https://joinmastodon.org/#getting-started')
|
||||||
else
|
else
|
||||||
ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_path)
|
ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_path)
|
||||||
end
|
end
|
||||||
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?
|
def omniauth_only?
|
||||||
ENV['OMNIAUTH_ONLY'] == 'true'
|
ENV['OMNIAUTH_ONLY'] == 'true'
|
||||||
end
|
end
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
%li= link_to t('auth.register'), available_sign_up_path
|
%li= link_to t('auth.register'), available_sign_up_path
|
||||||
|
|
||||||
- if controller_name != 'passwords' && controller_name != 'registrations'
|
- 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?)
|
- 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?
|
- if user_signed_in?
|
||||||
%li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }
|
%li= link_to t('auth.logout'), destroy_user_session_path, data: { method: :delete }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user