Comments (4)
This seems like something that should be explained in the docs. I'm going to handle this as an issue with the docs.
Anyway, the fetch request should be sent like this:
await fetch("/some-endpoint", {
headers: {
Authorization: `Bearer ${access_token}`
}
}
from lucia.
Thank you for the fast reply!
Maybe I didn't explain it well enough, I'm not talking about using fetch
for an endpoint but using a page-endpoint. As this is called directly on navigation, I'm not sure we can set auth headers here
from lucia.
Oh, yeah, my bad.
Unfortunately, you'll need to create a load function for the page and send a request from it.
from lucia.
With the recent 0.5.1 update, you can use validateRequestByCookie
to validate requests using cookies, so no load functions needed!
from lucia.
Related Issues (20)
- [Bug]: Jest Encounters Unexpected Token 'export' When Testing TypeScript with ESM Modules HOT 3
- [Feature Request]: Are We Turbo Yet? HOT 2
- [Feature Request]: Removing user handling HOT 1
- [Feature Request]: Xata Adapter HOT 2
- [Bug]: Type Issue: Validaterequest function implementation returns user type of Id even though User contains other attributes. HOT 2
- [Docs]: Adding the function definitions using jsDoc, in Typescript
- [Bug]: lucia.validateSession returns `null` for both `session` and `user` using @lucia-auth/adapter-mongodb in Next.js App Router HOT 1
- [Feature Request]: EXPO/REACT-NATIVE HOT 1
- [Feature Request]: Support for MongoDB `_id` in Custom Database Adapter HOT 1
- [Feature Request]: `getSessionAndUser()` should not select ALL columns of user table HOT 2
- [Feature Request]: `validateSession()` should not get user by default HOT 1
- [Bug]: Use proper Object ids instead of string. HOT 4
- [Bug]: Type Compatibility Issue with CookieAttributes and AstroCookieSetOptions HOT 5
- [Bug]: @lucia-auth/adapter-postgresql has no export member 'pg' HOT 2
- [Docs]: Dark Mode option for the docs HOT 1
- [Bug]: SessionCookieAttributesOptions missing sameSite: "none" type
- [Docs]: use of "sure sure" seems unintentional HOT 2
- [Feature Request]: Edgedb adapter HOT 4
- oauth and nuxt tutortial (using mongodb)
- [Feature Request]: Telegram Mini App AND Lucia Auth HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lucia.