Module: Authstrategies::Helpers

Defined in:
lib/authstrategies/helpers.rb

Instance Method Summary collapse

Instance Method Details

#authenticate!(strategy = :password) ⇒ Object



3
4
5
# File 'lib/authstrategies/helpers.rb', line 3

def authenticate! strategy = :password
	env['warden'].authenticate! strategy
end

#authenticated?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/authstrategies/helpers.rb', line 7

def authenticated?
	env['warden'].authenticated?
end

#current_userObject



11
12
13
# File 'lib/authstrategies/helpers.rb', line 11

def current_user
	env['warden'].user
end

#login_pathObject



19
20
21
# File 'lib/authstrategies/helpers.rb', line 19

def 
	'/login'
end

#logoutObject



15
16
17
# File 'lib/authstrategies/helpers.rb', line 15

def logout
	env['warden'].logout
end

#logout_pathObject



23
24
25
# File 'lib/authstrategies/helpers.rb', line 23

def logout_path
	'/logout'
end

#signup_pathObject



27
28
29
# File 'lib/authstrategies/helpers.rb', line 27

def 
	'/signup'
end