Commit f5d2f13e authored by Cynthia Oliveira's avatar Cynthia Oliveira

Merge branch 'Issue#142' into 'master'

fix error when user puts wrong password
Signed-off-by: Matheus Horstmann's avatarMatheus Horstmann <mch15@inf.ufpr.br>

See merge request !249
parents 6ce89852 28f05b2c
......@@ -21,20 +21,23 @@ class SessionsController < Devise::SessionsController
# yield resource if block_given?
# respond_with resource, location: after_sign_in_path_for(resource)
# Get status of current city
current_city = CityHall.find_by(city_id: current_citizen.city_id)
# Get resource
self.resource = warden.authenticate!(auth_options)
# Check if resource is not null and if a citizen has been signed_in
if !resource.nil? && citizen_signed_in?
# Get status of current city
current_city = CityHall.find_by(city_id: current_citizen.city_id)
# if !resource.active
# sign_out(resource)
# flash[:alert] = "Sua conta está inativa, por favor contate o administrador!"
# return redirect_to root_path
# end
# Set expiretion time to send message when expiring session
session[:expires_at] = Time.current + 24.hours
# Set variable to show loading bar
......@@ -81,7 +84,7 @@ class SessionsController < Devise::SessionsController
# set_flash_message(:notice, :signed_in) if is_navigational_format?
# sign_in(resource_name, resource)
# respond_with resource, :location => root_path
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment