Sha256: ae412cbd2bed7193ebe59b9edab1d33c17e573f4c92ffac770d710d289f88059

Contents?: true

Size: 589 Bytes

Versions: 24

Compression:

Stored size: 589 Bytes

Contents

class AuthenticationController < Eucalypt::Controller(route: '/auth')
  helpers AuthenticationHelper if defined? AuthenticationHelper

  get '/login' do
    redirect '/' if authenticated?
    erb :'authentication/login', layout: false
  end

  post '/login' do
    redirect '/' if authenticated?
    authenticate
    redirect session[:return_to] || '/'
  end

  get '/logout' do
    env['warden'].logout
    redirect to '/login'
  end

  post '/invalid' do
    session[:return_to] = env['warden.options'][:attempted_path]
    status 403 # Unauthenticated
    redirect to '/login'
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
eucalypt-0.8.0 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.7.2 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.7.1 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.7.0 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.6.2 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.6.1 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.6.0 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.5.4 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.5.3 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.5.2 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.5.1 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.5.0 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.4.2 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.4.1 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.4.0 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.3.5 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.3.4 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.3.3 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.3.2 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt
eucalypt-0.3.1 lib/eucalypt/security/namespaces/security-warden/templates/auth_controller.tt