Skip to content

Hooks for authboss routes. #221

Closed
Closed
@frederikhors

Description

@frederikhors

Issue opened for the creation of a wiki page that summarizes the doubts and problems for newbies (#210).

I was wondering if there is a way to do something when a user reach, let's say, the route "/logout".

Use case:

I have many cookies and I need to delete all of them when I visit "/logout" (using ab.Config.Modules.LogoutMethod = "GET").

Now I don't know how to do because my router is:

r.Group(func(r chi.Router) {
	r.Use(auth.DataInjector)
	r.Use(authboss.ModuleListMiddleware(config.Ab))
	r.Mount(AUTH_URL, http.StripPrefix(AUTH_URL, config.Ab.Config.Core.Router))
})
  • Maybe I can wrap(something)?
  • Maybe a simple middleware which detects the right "/path"?
  • Can we call them "hooks"?

What is the best method?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions