mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Add basic self hosted onboarding (#1177)
* Add basic self hosted onboarding * Lint fix * Normalize translations
This commit is contained in:
parent
0149ca4ea1
commit
d3d9af8bce
6 changed files with 37 additions and 3 deletions
|
@ -17,7 +17,11 @@ module Authentication
|
|||
if user = User.find_by(id: session[:user_id])
|
||||
Current.user = user
|
||||
else
|
||||
redirect_to new_session_url
|
||||
if self_hosted_first_login?
|
||||
redirect_to new_registration_url
|
||||
else
|
||||
redirect_to new_session_url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,4 +40,8 @@ module Authentication
|
|||
def set_last_login_at
|
||||
Current.user.update(last_login_at: DateTime.now)
|
||||
end
|
||||
|
||||
def self_hosted_first_login?
|
||||
Rails.application.config.app_mode.self_hosted? && User.count.zero?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue