Class: Auth::Sentry
- Inherits:
-
Object
- Object
- Auth::Sentry
- Defined in:
- lib/auth/sentry.rb
Defined Under Namespace
Classes: User
Instance Method Summary collapse
- #authenticate! ⇒ Object
-
#initialize(request) ⇒ Sentry
constructor
A new instance of Sentry.
- #user ⇒ Object
Constructor Details
#initialize(request) ⇒ Sentry
Returns a new instance of Sentry.
8 9 10 |
# File 'lib/auth/sentry.rb', line 8 def initialize(request) @request = request end |
Instance Method Details
#authenticate! ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/auth/sentry.rb', line 12 def authenticate! if Auth.authenticate_account(@request.params['username'], @request.params['password']) @user_id = @request.params['username'] else raise AuthException, 'Invalid username or password' end end |