rename username to email

This commit is contained in:
Karol Selak 2021-03-20 22:37:38 +01:00
parent 7412853a3e
commit cd40ef66c6
9 changed files with 18 additions and 13 deletions

View file

@ -3,7 +3,7 @@ class SessionsController < ApplicationController
end
def create
@user = User.find_by(username: params[:username])
@user = User.find_by(email: params[:email])
if @user && @user.authenticate(params[:password])
session[:user_id] = @user.id
end