Repository URL to install this package:
Version:
4.0.0.pre.1 ▾
|
# frozen_string_literal: true
# Top-level module documentation comment goes here...
module Sinatra
# Generic authentication helpers
module AuthHelpers
def authenticated?
session[:username] && !session[:username].empty?
end
def require_authentication
return if authenticated?
authenticate!
raise http_status(403) unless authenticated?
end
end
end