Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Post Authentication Hook #185

Open
airstandley opened this issue May 27, 2020 · 2 comments
Open

Feature: Post Authentication Hook #185

airstandley opened this issue May 27, 2020 · 2 comments
Labels
enhancement New feature or request validation Concerns request and response validation

Comments

@airstandley
Copy link
Contributor

Ran into a use case where a dev wanted to run some code before all handlers after authentication had run. The dev was trying to use the before_request hook which probably would have worked if we were doing auth in middleware or with a hook like other frameworks do.

Unfortunately as it stands the only way to do this in rebar currently is to modify the Authenticator. This seems like something that we should really have a hook for so that devs can easily add code to be run after authentication but before the handler.

@Sytten
Copy link

Sytten commented May 27, 2020

Where would you put this parameter? In the registry constructor? Otherwise I feel like a simple decorator could do the trick.

@airstandley
Copy link
Contributor Author

No parameter. Either the rebar object or the registry object would hold the hook function list reference and expose the method to register(add) another function to be run after authentication but before the handler.

@airstandley airstandley added enhancement New feature or request validation Concerns request and response validation labels Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request validation Concerns request and response validation
Projects
None yet
Development

No branches or pull requests

2 participants