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,14 +21,17 @@ class SessionsController < Devise::SessionsController ...@@ -21,14 +21,17 @@ class SessionsController < Devise::SessionsController
# yield resource if block_given? # yield resource if block_given?
# respond_with resource, location: after_sign_in_path_for(resource) # 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 # Get resource
self.resource = warden.authenticate!(auth_options) self.resource = warden.authenticate!(auth_options)
# Check if resource is not null and if a citizen has been signed_in # Check if resource is not null and if a citizen has been signed_in
if !resource.nil? && citizen_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 # if !resource.active
# sign_out(resource) # sign_out(resource)
# flash[:alert] = "Sua conta está inativa, por favor contate o administrador!" # flash[:alert] = "Sua conta está inativa, por favor contate o administrador!"
......
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