When updating the page at the same time for two users, axios interceptor intercepts someone else's request - axios

When updating the page at the same time for two users, axios interceptor intercepts someone else's request. What could be the problem?

Related

204 "No Content" Response on Failing DELETE Request

We're currently testing a Microsoft Graph API integration that works with the Calendar created in Bookings. We aren't running off the Bookings API as it is still in preview and lacks certain data points, but rather interfacing directly with the underlying calendar as it works and syncs properly with Bookings, as long as you stick to basic operation such as GETS and DELETES.
We ran into an odd scenario in which the Graph API returns a 204 NO CONTENT status on a failing DELETE request. The user being tested has REVIEWER folder permissions on the calendar. When a DELETE request goes out, the event does not delete (as intended with someone who only had REVIEWER permissions), however the response received is a 204 NO CONTENT response, which should only be returning upon a successful request according to the Graph API Documentation.
Sample:
//Signed in user is listed a REVIEWER on calendar
REQUEST: DELETE https://graph.microsoft.com/v1.0/users/{id}/events/{id}
RESPONSE: 204 NO CONTENT //Even though calendar event remains
Is this an issue with the Graph API or do I need to get permissions issues for failed requests another way? Seems wrong it would show successful for a failed request, but I know things may get weird working with the underlying calendar.
Try to clear the cache and cookies, and then re-execute the request.
I think there is something wrong with your request URL, please change to:
https://graph.microsoft.com/v1.0/users/{user_id}/calendar/events/{id}
or
https://graph.microsoft.com/v1.0/users/{user_id}/calendars/{id}/events/{id}
After my test, it can work well for me.

Handle multiple guzzle request in proxy for REST API (local server crashes)

I have the following case: I have a REST API, that can only be accessed with credentials. I need the frontend to make requests directly to the API to get the data. Because I don't want to hide the credentials somewhere in the frontend, I set up a proxy server, which forwards my request with http://docs.guzzlephp.org/en/stable/index.html but adds the necessary authentication.
No that worked neatly for some time, but now I added a new view where I need to fetch from one more endpoint. (so far it was 3 requests locally (MAMP))
Whenever I add a fourth API request, which all are being executed right on page load, my local server crashes.
I assume it is linked to this topic here:
Guzzle async requests not really async?, specifically because I make a new request for every fetch.
First: Do you think that could be the case? Could my local server indeed crash, because I have only 3 (probably simultaneous) requests?
Second: How could I approach this problem.
I don't really see the possibility to group the requests, because they are just incoming to the proxy url and every call of the proxy url will create a new Guzzle client with its own request...
(I mean, how many things can a simple PHP server execute at the same time? And why would it not just add requests to the call stack and execute them in order?)
Thanks for any help on this issue.

Facebook Oauth Servicestack not working

We have been using servicestack as framework for web services, we also uses its SSO with FB, LinkedIn, GooglePlus features.
We enable them like this
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new FacebookAuthProvider(appSettings),
new GoogleOAuth2Provider(appSettings),
new TwitterAuthProvider(appSettings),
new LinkedInOAuth2Provider(appSettings)}
From 3/27 the FB SSO stops working on our site but the other SSO's like LinkedIn works fine. When I debug for facebook SSO, we are getting the Auth_Code from the FB back to our services, but I am assuming the server to server communication is failing while passing(code, secret). It is just an assumption made as the Auth_token is not set in session. If you came to know that FB updates something in OAuth process that ServiceStack not follows or anything like that, please provide me that info links.
I am wrong in my assumption "we are getting the Auth_Code from the FB back to our services, but I am assuming the server to server communication is failing while passing(code, secret). It is just an assumption made as the Auth_token is not set in session." Using the fiddler I am able to see the server-to-server communication for exchanging Auth_Code, Client_Secret with Access_Token. I see the Token response. After that I was taken back to my ReferralURL. In my Referral end point I am getting the Usersession.ProviderOAuthAccess, It has the Facebook provider but I don't see any Token information in it. This is really an interesting chase. Please help me with any other ideas to test.
I found added info: After getting the Access_Token froom FB, the immediate call is https://avatars.io/facebook/?size=medium initiated by service-stack.
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/FacebookAuthProvider.cs
At line 73 of FacebookAuthProvider.cs it calls OnAuthenticated function whoch calls OnAuthenticated function at line 171
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/CredentialsAuthProvider.cs
which calls the function SafeAddMetadata at line 177 of the file
https://github.com/ServiceStack/ServiceStack/blob/v4.0.50/src/ServiceStack/Auth/AuthMetadataProvider.cs
Finally triggers this:
"http://avatars.io/facebook/{0}?size=medium".Fmt(tokens.UserName));
Which seems that the tokens.username is empty from my network flow. This issue is beyond my thinking. It used to work, just stopped suddenly not sure what happened, we even don't even upgrade servicestack or servicestack.OAuth packages.

Book a cab on my behalf, the code is not production ready, how to proceed then?

I am trying to do an auto-booking of a cab from my code for uber, only for me.
I have my clientID, client Secret and Access Token. How to use them so that i can fire a request and monitor the status whether has been booked or not? Or if no cabs are available it would retry at specific intervals unless a cab gets booked.
Please guide me.
In the meantime while i am trying to fire a v1/me, i am getting 401 Unauthorized.
Did you try following the Authentication tutorial to understand if the requests you fire are as expected?
Also, you're getting down voted because there is code or anything that would enable us to help you debug this issue. If the hints in the tutorial do not help, please provide more details on the headers you add. You need to have the authorization header: Authorization: Bearer <YOUR_ACCESS_TOKEN> with a valid access_token.

How to send permanently a request to my http server

I have a http server running on my pc that I developed using C++.
I need to send permanently a request from the browser to my server (every 1s) in order to refresh my web page's content.
How can I do it?
Thanks for your help :))
This is the kind of thing that AJAX was designed for. Client-side scripting can send requests, such as in a timer, to update specific areas of the page's content without reloading the entire page each time.
Otherwise, look at HTTP server-side pushing to push new data to the client whenever it changes.