Module: Sinatra::ADAuth::Helpers

Defined in:
lib/sinatra/ad_auth.rb

Instance Method Summary collapse

Instance Method Details

#authorize!Object



12
13
14
# File 'lib/sinatra/ad_auth.rb', line 12

def authorize!
  redirect '/login' unless authorized?
end

#authorized?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/sinatra/ad_auth.rb', line 8

def authorized?
  session[:authorized]
end

#logout!Object



16
17
18
# File 'lib/sinatra/ad_auth.rb', line 16

def logout!
  session[:authorized] = false
end