Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
More linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
reesericci committed Jan 18, 2024
1 parent f37619d commit d50cc52
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def register
end

def create
if User::User.find_by(email: params[:email]) != nil
if !User::User.find_by(email: params[:email])
if User::User.find_by(email: params[:email]).verified == false
user = User::User.find_by(email: params[:email])
session[:current_user_id] = user.id
Expand Down Expand Up @@ -46,7 +46,7 @@ def verify_email
if u.use_otp(params[:code]) == true
session[:email_verified] = true
if params[:skip_passkey] == "true"
u.update(verified: true)
u.update!(verified: true)
session[:authenticated] = true
redirect_to controller: "domains", action: "index"
else
Expand All @@ -73,7 +73,7 @@ def update
@user.verified = false
end

@user.save
@user.save!

redirect_to(controller: "users", action: "settings")
end
Expand Down
4 changes: 2 additions & 2 deletions app/models/user/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ def mint_otp
end

def use_otp(token)
if begin
if !begin
@hotp.verify(token.to_s, self.otp_counter.to_i)
rescue
nil
end != nil &&
end.nil? &&
Time.now.to_i <= otp_last_minted + 600

self.otp_last_minted = nil
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
config.force_ssl = true

# Log to STDOUT by default
config.logger = ActiveSupport::Logger.new("#{Rails.root.join("log/production.log")}")
config.logger = ActiveSupport::Logger.new(Rails.root.join("log/production.log"))
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }

Expand Down

0 comments on commit d50cc52

Please sign in to comment.