Skip to content

Commit

Permalink
Merge pull request #2621 from manyfold3d/fix-first-use
Browse files Browse the repository at this point in the history
Fix first use authentication
  • Loading branch information
Floppy committed Sep 4, 2024
2 parents 92f5397 + de0038b commit 5ec42c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def authenticate_admin_user!
end

def check_for_first_use
authenticate_user! if User.count == 0
redirect_to(edit_user_registration_path) if current_user&.reset_password_token == "first_use"
end

Expand Down
1 change: 1 addition & 0 deletions app/controllers/health_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class HealthController < ApplicationController
after_action :verify_policy_scoped, except: :index
skip_before_action :check_for_first_use

def index
render json: {status: "OK"}, status: :ok
Expand Down

0 comments on commit 5ec42c1

Please sign in to comment.