Skip to content

Include a generate templates for adding padrino-warden to a project #894

Closed
postmodern opened this Issue Aug 7, 2012 · 7 comments

8 participants

@postmodern

It would be nice if there were generator templates for padrino-warden.

config/warden.rb

require 'warden'

Warden::Strategies.add(:password) do
  def valid?
    params["email"] || params["password"]
  end

  def authenticate!
    u = User.authenticate(params['email'], params['password'])
    u.nil? ? fail!("Could not log in") : success!(u)
  end
end

Warden::Manager.serialize_into_session do |user|
  user.id
end

Warden::Manager.serialize_from_session do |id|
  User.get(id)
end

app.rb

  register Padrino::Warden
@nesquena
Padrino Framework member
nesquena commented Aug 7, 2012

Good idea, hope to set that up soon.

@pepe
pepe commented Aug 9, 2012

+1

@achiu achiu was assigned Aug 19, 2012
@nullthreat

another vote for this

@ghost
ghost commented Nov 28, 2012

thumbsup!

@DAddYE
Padrino Framework member
DAddYE commented Jan 5, 2013

can be moved in padrino-contrib?

@dariocravero
Padrino Framework member

makes sense

@nesquena
Padrino Framework member

I still believe in this but it seems like it could go into contrib certainly and/or probably won't be worked on for 0.12.0. Moving to 0.12.1 for now.

@ujifgc
Padrino Framework member
ujifgc commented Jan 22, 2014

It should really go to padrino-contrib.

@ujifgc ujifgc closed this Jan 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.