36005.patch

Felix Schäfer, 2021-10-18 14:30

Download (2.14 KB)

View differences:

lib/redmine/twofa/base.rb
53 53
      end
54 54

  
55 55
      def deliver_twofa_paired
56
        ::Mailer.security_notification(
56
        ::Mailer.deliver_security_notification(
57 57
          @user,
58 58
          User.current,
59 59
          {
......
63 63
            field: "twofa__#{scheme_name}__name",
64 64
            url: {controller: 'my', action: 'account'}
65 65
          }
66
        ).deliver
66
        )
67 67
      end
68 68

  
69 69
      def destroy_pairing!(code)
......
82 82
      end
83 83

  
84 84
      def deliver_twofa_unpaired
85
        ::Mailer.security_notification(
85
        ::Mailer.deliver_security_notification(
86 86
          @user,
87 87
          User.current,
88 88
          {
......
90 90
            message: 'twofa_mail_body_security_notification_unpaired',
91 91
            url: {controller: 'my', action: 'account'}
92 92
          }
93
        ).deliver
93
        )
94 94
      end
95 95

  
96 96
      def send_code(controller: nil, action: nil)
......
115 115
        # make sure the user using the backup code is the same it's been issued to
116 116
        return false unless @user.present? && @user == user_from_code
117 117

  
118
        ::Mailer.security_notification(
118
        ::Mailer.deliver_security_notification(
119 119
          @user,
120 120
          User.current,
121 121
          {
......
124 124
            message: 'twofa_mail_body_backup_code_used',
125 125
            url: {controller: 'my', action: 'account'}
126 126
          }
127
        ).deliver
127
        )
128 128
        return true
129 129
      end
130 130

  
......
136 136
          token.update_columns value: Redmine::Utils.random_hex(6)
137 137
          tokens << token
138 138
        end
139
        ::Mailer.security_notification(
139
        ::Mailer.deliver_security_notification(
140 140
          @user,
141 141
          User.current,
142 142
          {
......
144 144
            message: 'twofa_mail_body_backup_codes_generated',
145 145
            url: {controller: 'my', action: 'account'}
146 146
          }
147
        ).deliver
147
        )
148 148
        tokens
149 149
      end
150 150