Module: Sinatra::Authentication

Defined in:
lib/sinatra/authentication.rb,
lib/sinatra/authentication/user.rb,
lib/sinatra/authentication/cookies.rb,
lib/sinatra/authentication/helpers.rb,
lib/sinatra/authentication/password.rb,
lib/sinatra/authentication/login_field.rb,
lib/sinatra/authentication/validations.rb,
lib/sinatra/authentication/identification.rb

Defined Under Namespace

Modules: Cookies, Helpers, Identification, LoginField, Password, User, Validations

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#require_auth(path_prefix) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/sinatra/authentication.rb', line 16

def require_auth(path_prefix)
    before do
        if request.fullpath =~ /^#{path_prefix}/
            require_auth
        end
    end
end