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

Configurable Auth Token Location. #579

Closed
Muxoid opened this issue May 10, 2024 · 2 comments
Closed

Configurable Auth Token Location. #579

Muxoid opened this issue May 10, 2024 · 2 comments

Comments

@Muxoid
Copy link
Contributor

Muxoid commented May 10, 2024

Description

I would like to be able to use cookies for authenticating instead of having a plain header so that it is sent automatically with each request. This would be made easier with a request like this:

curl --location --request GET '127.0.0.1:3000/api/user/current'
--header 'Content-Type: application/json'
--Cookie 'Authorization=Bearer TOKEN'

instead of the current:

curl --location --request GET '127.0.0.1:3000/api/user/current'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer TOKEN'

At the moment there is no easy way to customize this.

Expected Behavior

To be able to use cookies to authenticate to be able to simplify the client-side authentication logic. Making this a config option would make the framework more flexible.

Additional Context

I am currently working with Loco and HTMX, therefore I render simple pages and I would like to use the built-in authentication methods without client-side JS.

@Muxoid Muxoid changed the title Configurable AUTH_HEADER Variable. Configurable Auth Token Location. May 11, 2024
@kaplanelad
Copy link
Contributor

Hey @Muxoid

In the next release version, we will add this option.
In the meantime, you can take the lib from git, and you will get this feature.

for more info take a look on this pr:
You can can follow this PR.

@kaplanelad
Copy link
Contributor

@Muxoid new version releases with this feature.
You can follow the guide here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants