Sha256: a4c2f22264788e9059655839364b9d043d79383cfaae4ced0eb3ce6120754641
Contents?: true
Size: 474 Bytes
Versions: 26
Compression:
Stored size: 474 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
26 entries across 26 versions & 1 rubygems