Module: Sinatra::SessionAuth::Helpers

Defined in:
lib/rbbt/workflow/rest/auth.rb

Instance Method Summary collapse

Instance Method Details

#authorize!Object



15
16
17
# File 'lib/rbbt/workflow/rest/auth.rb', line 15

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

#authorized?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/rbbt/workflow/rest/auth.rb', line 7

def authorized?
  session[:authorized]
end

#logout!Object



19
20
21
# File 'lib/rbbt/workflow/rest/auth.rb', line 19

def logout!
  session[:authorized] = false
end

#userObject



11
12
13
# File 'lib/rbbt/workflow/rest/auth.rb', line 11

def user
  session[:user]
end