class Kemal::Authorizer::AuthorizationHandler

Overview

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

Kemal::Authorizer::AuthorizationHandler.new({
  "/admin" => ["GET"],
})

If an user that is not an admin tries to visit "/admin" the user will be redirected to "/login?next=%2Fadmin".

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]