-
Notifications
You must be signed in to change notification settings - Fork 23
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
graphql unauthenticated #27
Comments
Hello again @alaamh , this might be a bit long but bear with my explanation. Regarding the unauthenticated requestsI'll assume familiarity dealing with sessions and cookies. Regarding the In your case, since you're querying But if you want something quick and dirty, here's an idea: Add this snippet to import { env } from '@/config/environment';
import { loginUseCase } from '../use-cases/login.use-case';
if (!env.isProduction) {
router.get('/api/v1/auth/logout', asyncHandler(logoutHandler));
router.get(
'/api/v1/auth/login/superadmin',
asyncHandler(async (req, res) => {
await loginUseCase(
{
email: 'superadmin@app.com',
password: 'password',
},
req.context,
);
res.send('superadmin logged in');
}),
);
} And then hit the newly registered REST GET endpoint via If somehow your session expires, just remove the cookies and hit that endpoint again (the frontend supertokens client knows how to refresh the session 🙂). But yea, the idea is to acquire a session so you can make authenticated requests. As for the
|
Thank you for your time and detail explanation. As you know we usually develop the frontend and backend side by side for that I use postman to authenticate and generate the token, as you highlighted I went to SuperTokens to find away to add the token |
@alaamh Can you try changing the |
As for the playground issue, just to make sure, do you mean the playground on |
yes, this what I mean. |
confirm, |
Which one? xD
Downgraded to 0.95.14 for the meantime. Pushed on |
The authentication issue is with the playground on |
Have you tried the snippet and hitting the endpoint? It should work. |
confirm, the |
getting below error in graphql studio while query objects, even with
verifySession({ sessionRequired: false })
I have comment
checkAuthentication
temporarily then got this error:The text was updated successfully, but these errors were encountered: