Class: Oath::Constraints::SignedOut

Inherits:
Object
  • Object
show all
Defined in:
lib/oath/constraints/signed_out.rb

Overview

Rails route constraint for signed out users

Since:

  • 0.0.15

Instance Method Summary collapse

Instance Method Details

#matches?(request) ⇒ Boolean

Checks to see if the constraint is matched by not having a user signed in

Since:

  • 0.0.15


8
9
10
11
# File 'lib/oath/constraints/signed_out.rb', line 8

def matches?(request)
  warden = request.env["warden"]
  warden && warden.unauthenticated?
end