Sha256: 8a14246f8de257c2a6cabaef98a1e16429408e0887bcd0fb5bfd21749f12cf82
Contents?: true
Size: 585 Bytes
Versions: 4
Compression:
Stored size: 585 Bytes
Contents
class AuthenticationController < Eucalypt::Controller(route: '/auth') helpers AuthenticationHelper if defined? AuthenticationHelper get '/login' do redirect '/' if current_user erb :'authentication/login', layout: false end post '/login' do redirect '/' if current_user 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
4 entries across 4 versions & 1 rubygems