class Kemal::Authorizer::AuthenticationHandler

Overview

Kemal::Authorizer::AuthenticationHandler is a middleware that makes sure that only authenticated users can visit the specified routes.

Kemal::Authorizer::AuthenticationHandler.new({
  "/dashboard" => ["GET"],
  "/logout" => ["POST"]
})

If an unauthenticated user tries to visit e.g. "/dashboard" the user will be redirected to "/login?next=%2Fdashboard".

Defined in:

kemal-authorizer/handlers.cr

Instance Method Summary

Constructor methods inherited from class Kemal::Authorizer::BaseHandler

new(auth_req_routes : Hash(String, Array(String))) new

Instance Method Detail

def call(context) #

[View source]