mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 17:46:22 +00:00
encontrar las clases
This commit is contained in:
parent
821e6b276d
commit
322df19d41
2 changed files with 8 additions and 8 deletions
|
@ -19,14 +19,14 @@ module Warden
|
||||||
# Autentica a una posible invitadx, no fallamos para que haya
|
# Autentica a una posible invitadx, no fallamos para que haya
|
||||||
# fallback con IMAP
|
# fallback con IMAP
|
||||||
def authenticate!
|
def authenticate!
|
||||||
u = Invitadx.find_by_email(params['username'])
|
u = ::Invitadx.find_by_email(params['username'])
|
||||||
|
|
||||||
if u.try(:authenticate, params['password'])
|
return unless u.try(:authenticate, params['password'])
|
||||||
if u.confirmed?
|
|
||||||
success! u
|
if u.confirmed?
|
||||||
else
|
success! u
|
||||||
fail! 'unconfirmed'
|
else
|
||||||
end
|
fail! 'unconfirmed'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -46,7 +46,7 @@ module Warden
|
||||||
@imap.login(@email.normal, params['password'])
|
@imap.login(@email.normal, params['password'])
|
||||||
@imap.disconnect
|
@imap.disconnect
|
||||||
|
|
||||||
success! Usuaria.find(@email.normal)
|
success! ::Usuaria.find(@email.normal)
|
||||||
rescue Net::IMAP::NoResponseError, EOFError => e
|
rescue Net::IMAP::NoResponseError, EOFError => e
|
||||||
@imap.disconnect
|
@imap.disconnect
|
||||||
Rails.logger.error e.to_s
|
Rails.logger.error e.to_s
|
||||||
|
|
Loading…
Reference in a new issue