dmayo2
"Deep linking" Why the disparity btn local & prod
Hey, I'm developing an app that uses Supabase's magicLink auth system. The user enters their email and a login link is emailed to them. The link hits Supabase's server with a token. After verification the user is redirected back my app with a JWT token. Straight forward enough.
In my case the redirect is to a page that is configed in my Routes. During development (localhost:3000/) everything works fine...the JWT is saved in local storage, I get logged in. No problems.
I push the code to Netlify by way of github, Netlify builds the app with no issues. However, when trying to log in to the production site, I was getting an error from Supabase
401: invalid claim: missing sub claim
. WTF.
Ok, in the receiving page of the production code (I chose App.jsx, but I might change that -- chime in below please) I had to basically code a callback.
Why?
Why would it work on localhost but not production?
This is the code I made. Should I keep it in App.jsx? I could move it to something like /token_process or whatever and have Supabase redirect to that single use page.
Thoughts/Comments/Suggestions are all welcomed.6 replies
parent of nested routes
Hello. Just looking for confirmation. I'm using Supabase Auth and that logic lives in RouteGuard. I'm pretty sure that all the routes nested within will be password protected.
My main question is: am I configuring the Index component correctly? Will I be able to access it? If an unauthenticated user goes to '/' (or any of the nested routes) they will be
navigate('/login')
.
I seem to be having an issue accessing '/' as an authenticated user. Should I rename the route for the Index component to someting like '/home'?
22 replies
sibling components
I've read the docs, and I just can't wrap my head around how to trigger a function in a sibling component.
Can anyone point to a reference that would explain it to a 5th grader? Thanks
Sibling-A has a list from a db
Sibling-B is able to remove a list item from db
I want Sibling-A to know that the item has been removed and re-render the list
7 replies
Page Refresh or Browser Button or ...
Good Day.
I'm trying to figure out if a page has been reloaded or entered naturally via a link, etc.
I've tried
window.performance.getEntriesByType("navigation")
but when I redirect via navigate('/page2')
that api thinks the page was refreshed.
Suggestions?1 replies
sibling function triggering
I've been beating my head against the wall and I'm looking for another suggestion.
In sidebar.jsx I have a list of names from a database. In a sibling comonent, main.jsx, I can rename that name in the database.
User clicks name in sidebar, it loads in main's form to rename and submit to database.
I can't seem to get the function that retrieves the list of names from the database to fire when the new name is submitted in main, and updates in the database.
I've tried using props from main to parent to sidebar.
I've tried using createRoot.
I've been putting the watcher in a createEffect in sidebar.
I just can't seem to get the function to re-fetch the database query and reload the list of names in sidebar.
Thoughts/Suggestions/Comments?
5 replies
[solved] Tutorial: server side routing for remote API call with keys
Hello. So, my app is coming along and I'm ready to start requesting APIs at openai.com.
Can any one point me to a good tutorial that explains, and shows, how my browser code can call a server page that will actually make the API call and return the data to the browser. Currently I'm calling APIs with Supabase. I plan on hosting with Netlify. Thanks for any suggestions.
Can any one point me to a good tutorial that explains, and shows, how my browser code can call a server page that will actually make the API call and return the data to the browser. Currently I'm calling APIs with Supabase. I plan on hosting with Netlify. Thanks for any suggestions.
4 replies
Passing signal from one template's function to a different template function
I've been reading so much I think I've confused myself more. If I
createSignal()
in header.jsx
how can I use that value in footer.jsx
Any pointers would be appreciated.18 replies
Netlify Fails to accept `dist`
I have many sites on Netlify from HUGO, and this is my first SolidJS. I ran
npm run build
and created the /dist
dir. I drag that dir to netlify and it gives an error (but no error code). This is my first attempt. I searched here, didn't see anything relevant, and followed the directinos on netlify site (https://www.netlify.com/blog/how-to-deploy-solidjs/). "Looks like something went wrong!"
No errors on build npm run build
other than css/responsive.css doesn't exist at build time, it will remain unchanged to be resolved at runtime
which are in /public/assets
Any suggestions where/how to start my search?4 replies