Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/callbacks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_identity_with_otp(sofia_account, user)
if params[:verification_code].blank?
# OTP code not present, so request it
render(json: { state: 'otp_prompt' })
elsif sofia_account.authenticate_otp(params[:verification_code])
elsif sofia_account.authenticate_otp(params[:verification_code], drift: 60)
# OTP code correct
sign_in(:user, user)
render(json: { state: 'logged_in', redirect_url: user.roles.any? ? root_path : user_path(user.id) })
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sofia_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def enable_otp # rubocop:disable Metrics/AbcSize, Metrics/MethodLength

begin
flash_message =
if @sofia_account.authenticate_otp(params.require(:verification_code))
if @sofia_account.authenticate_otp(params.require(:verification_code), drift: 60)
if @sofia_account.update(otp_enabled: true)
{ success: 'Two-factor-authenticatie aangezet!' }
else
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/zatladder_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ def current_year
end

def zatladder_spendings(from, to)
@users_spendings = User.in_amber.calculate_spendings(from:, to:)
zatladder = User.in_amber.select(:id, :name).map do |user|
users = User.in_amber.exists? ? User.in_amber : User.sofia_account
@users_spendings = users.calculate_spendings(from:, to:)
zatladder = users.select(:id, :name).map do |user|
{
id: user.id,
name: user.name,
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20251212000001_add_order_total_back_to_orders.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddOrderTotalBackToOrders < ActiveRecord::Migration[7.2]
def change
add_column :orders, :order_total, :decimal, precision: 8, scale: 2 unless column_exists?(:orders, :order_total)
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2025_12_09_160709) do
ActiveRecord::Schema[7.2].define(version: 2025_12_12_000001) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down
Loading