Sha256: 03a09b43921b424a93f35d1bbaadc381fe81d1e63fe3049a3821920417f2e6cf

Contents?: true

Size: 500 Bytes

Versions: 16

Compression:

Stored size: 500 Bytes

Contents

require 'rubygems'
require 'ramaze'

# Small application performing authentication without a database

module Auth
  USERS = {
    'demo'    => Digest::SHA1.hexdigest('demo'),
    'manveru' => Digest::SHA1.hexdigest('letmein'),
  }

  class AuthController < Ramaze::Controller
    map '/', :auth
    app.location = '/'

    helper :auth
    layout :auth
    trait :auth_table => USERS

    before(:secret){ login_required }
    before(:login){ redirect r('/') if logged_in? }
  end
end

Ramaze.start

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ramaze-2023.01.06 examples/app/auth/start.rb
ramaze-2012.12.08 examples/app/auth/start.rb
ramaze-2012.12.08b examples/app/auth/start.rb
ramaze-2012.04.14 examples/app/auth/start.rb
ramaze-2012.03.07 examples/app/auth/start.rb
ramaze-2011.12.28 examples/app/auth/start.rb
ramaze-2011.10.23 examples/app/auth/start.rb
ramaze-2011.07.25 examples/app/auth/start.rb
ramaze-2011.01.30 examples/app/auth/start.rb
ramaze-2011.01 examples/app/auth/start.rb
ramaze-2010.06.18 examples/app/auth/start.rb
ramaze-2010.04.04 examples/app/auth/start.rb
ramaze-2010.04 examples/app/auth/start.rb
ramaze-2010.03 examples/app/auth/start.rb
ramaze-2010.01 examples/app/auth/start.rb
ramaze-2009.10 examples/app/auth/start.rb