Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update to use newer shield version style.

  • Loading branch information...
commit a81ec61e4ae3d40f3a44cc2eb25d85efb1f08950 1 parent 22521d8
@cyx cyx authored
Showing with 2 additions and 7 deletions.
  1. +1 −6 models/user.rb
  2. +1 −1  routes/guests.rb
View
7 models/user.rb
@@ -1,16 +1,11 @@
class User < Ohm::Model
- extend Shield::Model
+ include Shield::Model
attribute :email
attribute :crypted_password
-
unique :email
def self.fetch(identifier)
with(:email, identifier)
end
-
- def password=(password)
- self.crypted_password = Shield::Password.encrypt(password)
- end
end
View
2  routes/guests.rb
@@ -8,7 +8,7 @@ class Guests < Cuba
on post, param("username"), param("password") do |user, pass|
if login(User, user, pass, req[:remember])
session[:success] = "You have successfully logged in."
- res.redirect(session.delete(:return_to) || "/")
+ res.redirect("/dashboard")
else
session[:error] = "Invalid username and/or password combination."
res.write view("login", title: "Login", username: user)
Please sign in to comment.
Something went wrong with that request. Please try again.