Sha256: 249849665c93da6b32a60cdd3392605bc19d8ad58cec0b1cf9804a4938cadb7c
Contents?: true
Size: 453 Bytes
Versions: 17
Compression:
Stored size: 453 Bytes
Contents
Warden::Strategies.add(:password) do def subdomain ActionDispatch::Http::URL.extract_subdomains(request.host, 1) end def valid? subdomain.present? && params["user"] end def authenticate! return fail! unless account = Mtwarden::Account.find_by(subdomain: subdomain) return fail! unless user = account.users.find_by(email: params["user"]["email"]) return fail! unless user.authenticate(params["user"]["password"]) success! user end end
Version data entries
17 entries across 17 versions & 1 rubygems