Skip to content

Commit

Permalink
Extract account creation into a separate method
Browse files Browse the repository at this point in the history
  • Loading branch information
janko committed Dec 10, 2024
1 parent 32efb7c commit fa57c64
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/rodauth/features/omniauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ def _handle_omniauth_callback
transaction do
if !account
if omniauth_create_account?
omniauth_new_account
before_omniauth_create_account
omniauth_save_account
after_omniauth_create_account
omniauth_create_account
else
set_redirect_error_flash omniauth_login_no_matching_account_error_flash
redirect omniauth_login_failure_redirect
Expand Down Expand Up @@ -166,6 +163,13 @@ def omniauth_create_account?
true
end

def omniauth_create_account
omniauth_new_account
before_omniauth_create_account
omniauth_save_account
after_omniauth_create_account
end

def _omniauth_new_account(login)
acc = { login_column => login }
unless skip_status_checks?
Expand Down

0 comments on commit fa57c64

Please sign in to comment.