Commit 8922e7e
Changed files (4)
app/models/authentication.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class Authentication < ApplicationRecord
belongs_to :user
end
app/models/password_authentication.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class PasswordAuthentication < Authentication
def authenticate(password)
user.authenticate(password)
app/models/totp_authentication.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class TotpAuthentication < Authentication
def authenticate(code)
user.mfa.authenticate(code) ? user : false
db/migrate/20180922174543_create_authentications.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
class CreateAuthentications < ActiveRecord::Migration[5.2]
def change
create_table :authentications do |t|