Record and show the last time users have logged in

This commit is contained in:
Jyri-Petteri Paloposki 2020-08-10 16:54:48 +03:00
parent 950da89d76
commit 1936c90c95
4 changed files with 10 additions and 1 deletions

View file

@ -14,6 +14,7 @@ class LoginController < ApplicationController
case request.method
when 'POST'
if @user = User.authenticate(params['user_login'], params['user_password'])
@user.update_attribute(:last_login_at, Time.now)
return handle_post_success
else
handle_post_failure