것은 내가 사용자가 로그인하는 것을보고 싶습니다 로그인 한 사용자의 4. 가져 오기 목록을 레일에 서명이유증 3.11. 내 관리 인터페이스에서 오전 때
, ?
, 나는 추적 가능한 기능을 추가하지
내 이동
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip
사용자가 :current_sign_in_at
으로 로그 아웃하고 :current_sign_in_ip
이 nil로 설정되지 않은 경우 문제가 발생합니다.
def destroy
current_user.current_sign_in_at = nil
current_user.save
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(current_user))
set_flash_message :notice, :signed_out if signed_out
redirect_to root_url
end
가 이제 current_sign_in_at
가 업데이트 내 sessions_controller.rb이 추가되었습니다.
그런 다음 :timeoutable
mpdule을 추가했습니다. 세션이 시간 초과되면 current_sign_in_at
이 업데이트되지 않습니다.
이 모든 해킹이 끝난 후, 나는 wounder를 시작합니다. 이렇게하는 것이 더 우아한 방법을 고안하지 않습니까?