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