Skip to content

Commit fa57c64

Browse files
committed
Extract account creation into a separate method
1 parent 32efb7c commit fa57c64

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/rodauth/features/omniauth.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ def _handle_omniauth_callback
8181
transaction do
8282
if !account
8383
if omniauth_create_account?
84-
omniauth_new_account
85-
before_omniauth_create_account
86-
omniauth_save_account
87-
after_omniauth_create_account
84+
omniauth_create_account
8885
else
8986
set_redirect_error_flash omniauth_login_no_matching_account_error_flash
9087
redirect omniauth_login_failure_redirect
@@ -166,6 +163,13 @@ def omniauth_create_account?
166163
true
167164
end
168165

166+
def omniauth_create_account
167+
omniauth_new_account
168+
before_omniauth_create_account
169+
omniauth_save_account
170+
after_omniauth_create_account
171+
end
172+
169173
def _omniauth_new_account(login)
170174
acc = { login_column => login }
171175
unless skip_status_checks?

0 commit comments

Comments
 (0)