i am not able to implement urql caching in nextjs
the problem is described in the readme of this repository
https://github.com/prasoonchatterjee/urql-caching/tree/main
i tried using the documentation but it wasnt that clear to me so i uploaded a dummy nextjs app to see where i am going wrong
https://github.com/prasoonchatterjee/urql-caching/tree/main
Related
Using a Laravel backend and sanctum for handling the PAT's
Main issue is that the gSSp runs before the react tree so im not able to access the localstorage or the context...
Tried using axios interceptor but not sure how to use it properly.
Yes i'm aware that it shouldn't be stored in the local storage, its a graded project and I needed to at least let it seem functional for presentation. But it needs to be hosted today and that's my main issue with identifying different users...
Any help would be appreciated...
Discord : Prøxïmïty#1506
Upload an api made in Spring Boot to heroku, all the Gets methods are working correctly, but the Posts have a problem where only the first request I make works, after that it doesn't work anymore, only if I restart the application. What do I do?
I have separate backend and frontend. However, they run on the same server (this may change in the future). The backend serves as an api and is powered by Laravel. Frontend by Nuxt (Vue).
I wish only my Nuxt application could access the api. How can I configure Laravel to only return data if the request comes from a Nuxt application?
I thought about adding a special token to requests, but the user will be able to check what request is coming out and capture the token. Can anyone give me ideas how this can be solved?
You must be knowing about CORS. So in your Laravel Server, allow requests from only the frontend server's domain like this:
Access-Control-Allow-Origin: https://www.example.com
Simplest solution would be to add serverMiddleware in the nuxt project and route all the requests to the "real" api through it. Clients will hit the internal nuxt api and they will not be able to see the actual request made to the real api. There you can also add the token you are talking about for extra layer of security.
I'm struggling with Wordpress REST API & authentication, I've went through tons of documentation and articles and videos, but still can't find answer that will clarify some things for me.
So here is what I'm trying to accomplish - I want to integrate Wordpress into existing static website (want to bring only recent posts to my homepage) and as advised in this post Integrate Wordpress recent posts into existing website i went for Wordpress REST API, which is very powerful and I managed to pull out only recent posts, but.......
Security issues:
If i use GET method in my AJAX call - it brings posts to my homepage right away easily.
If i use POST method - it asks for authentication.
Now from reading all articles I'm not even sure if it is safe to use GET method for this simple request or i have to use POST method?
Also, lot of people mentioned that if I use POST method without SSL (http instead of https) that it is not safe as well.
Is my website compromised if someone can see endpoint route in my request (e.g. http://somewebsite.com/wp-json/wp/v2/posts)?
Is it possible that someone can advise what is the best practice for my scenario?
GET or POST
Http or Https
Which authentication if i have to use one?
If i have to authenticate, where to store username and password - cookie or local storage?
Just keep in mind that i don't want to edit/add/delete any posts, just want to show them on my homepage, nothing else.
Please have understanding, since I am kind of a rookie when it comes to REST API
Thanks in advance
Generally it is always best to have SSLs on your sites.
If you are just attempting to display posts via an AJAX request you want GET request, and it is perfectly safe to use a GET request.
A POST request is used to create new content, which is why it is requiring authentication.
I'm building a Angular 6 front-end and Spring boot based REST api. Angular app is going to be hosted separately behind a nginx. I want to implement spring security in order to secure REST apis. As per my understanding I need to two following things.
Spring security to authenticate API calls for valid tokens and respond 403 if not
Angular library in order to redirect user to google login and maintain access/refresh tokens, pass access token for api calls in headers and refresh access token if backend respond with 403.
I'm not quite sure whether the authenticate request go via spring backend or directly to google.
I have been searching for a good tutorial for sometime but didn't find one matching my requirement( most are html pages hosted within spring ). So please correct if my understanding on how to do this is wrong and share if there are tutorials.
Check this article. This might be the article which help to you.
Moreover let me know if it worked.