Code Duplication    Length = 6-8 lines in 2 locations

app/controllers/sessions_controller.rb 1 location

@@ 122-129 (lines=8) @@
119
      user = User.from_omniauth(@auth)
120
121
      # Add pending role if approval method and is a new user
122
      if approval_registration && !@user_exists
123
        user.add_role :pending
124
125
        # Inform admins that a user signed up if emails are turned on
126
        send_approval_user_signup_email(user) if Rails.configuration.enable_email_verification
127
128
        return redirect_to root_path, flash: { success: I18n.t("registration.approval.signup") }
129
      end
130
131
      send_invite_user_signup_email(user) if Rails.configuration.enable_email_verification &&
132
                                             invite_registration && !@user_exists

app/controllers/users_controller.rb 1 location

@@ 47-52 (lines=6) @@
44
    @user.save
45
46
    # Set user to pending and redirect if Approval Registration is set
47
    if approval_registration
48
      @user.add_role :pending
49
50
      return redirect_to root_path,
51
        flash: { success: I18n.t("registration.approval.signup") } unless Rails.configuration.enable_email_verification
52
    end
53
54
    send_registration_email if Rails.configuration.enable_email_verification
55