Help with sappphire auth

i have problemms using the auth with sapphire
Solution:
if you do indeed have multiple outgoing requests they should also show up in the network tab
Jump to solution
16 Replies
isaacx
isaacxOP2mo ago
it continues giving me this error but the dashboard works, like all the data pass
No description
Favna
Favna2mo ago
we have quite a thorough guide on the website, have you carefully read each step? have you verified all your files to be similar to the guide? https://www.sapphirejs.dev/docs/Guide/plugins/API/getting-started Other than that, validate the REST request you're sending from the frontend to the backend api route.
Sapphire Framework
Getting Started | Sapphire
Introduction
isaacx
isaacxOP2mo ago
yes like it works look
isaacx
isaacxOP2mo ago
No description
isaacx
isaacxOP2mo ago
that is on the dashboard but i keep getting that error
Favna
Favna2mo ago
so you get both an okay response and an error response? that should not be possible
isaacx
isaacxOP2mo ago
yeah idk why
Favna
Favna2mo ago
sounds like you're making 2 requests. Add some logging to check all outgoing and incoming requests
isaacx
isaacxOP2mo ago
every time I log in the data pass ok and the api throws that error
isaacx
isaacxOP2mo ago
i also thouht that so i did this
No description
Favna
Favna2mo ago
Either way you can also add logging on the backend by editing files in node_modules. looks like you based the code off of https://github.com/skyra-project/skyra.pw/blob/main/src/pages/oauth/callback.tsx? Instead of using that code I would rather recommend using https://tanstack.com/query/latest to make backend requests, that code is quite outdated in terms of best practises. Tanstack Query (previously React Query) has among many other features automatic request deduplication.
TanStack Query
Powerful asynchronous state management, server-state utilities and data fetching. Fetch, cache, update, and wrangle all forms of async data in your TS/JS, React, Vue, Solid, Svelte & Angular applications all without touching any "global state"
isaacx
isaacxOP2mo ago
ill try to implement react query and see if it works
Solution
Favna
Favna2mo ago
if you do indeed have multiple outgoing requests they should also show up in the network tab
isaacx
isaacxOP2mo ago
oh yeah i see now there are 2 req
Favna
Favna2mo ago
yeah that'll be a problem for sure short of react query I recommend investigating why that is
isaacx
isaacxOP2mo ago
okay ill do that tysmm

Did you find this page helpful?