Ayush_kumar
Hi I am trying to login with google using SSR. The thing is working properly but I am getting error in the console that says:
TypeScript
Access to fetch at 'https://accounts.google.com/o/oauth2/v2/auth?client_id=751249844538-3ipogqq7glr6cigf74vj4jkuqqu8vllu.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fcloud.appwrite.io%2Fv1%2Faccount%2Fh%5C%2Fcallback%22%2C%22failure%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A3000%5C%2Fauth%5C%2Fsignup%3Ferror%3Dauth_failed%22%2C%22token%22%3Atrue%7D&response_type=code' (redirected from 'http://localhost:3000/api/auth/oauth/google?_rsc=109sb') from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
fetch-server-response.ts:106
GET https://accounts.google.com/o/oauth2/v2/auth?client_id=751249844538-3ipogqq7rruruigf74vj4jkuqqu8vllu.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fcloud.appwrite.io%2Fv1%2Faccount%2Fsessions%2Foauth2%2Fcallback%2Fgoogle%2F66952cc200353575435a1&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+openid&state=%7B%22success%22%3A%22http%3A%5C%2F%5C%2Flocalhost%3A3000%5C%2F3A3000%5C%2Fauth%5C%2Fsignup%3Ferror%3Dauth_failed%22%2C%22token%22%3Atrue%7D&response_type=code net::ERR_FAILED
fetchServerResponse
app-index.tsx:25 Failed to fetch RSC payload for
this is my folder structure
TypeScript
this is my folder structure
-- app/
-- api/
-- auth/
-- login/
-- oauth/
-- [provider]/
-- route.ts
-- callback/
-- route.ts
-- auth
TL;DR
Developers are encountering a CORS policy error while trying to login with Google using SSR. The error is due to a missing 'Access-Control-Allow-Origin' header. To resolve this, the developers should ensure that the server's response includes the necessary CORS headers. Recommended threads
- Got message for auto payment of 15usd fo...
how did this happen? 1. i claimed my 50usd credits via jsm hackathon - https://hackathon.jsmastery.pro/ 2. it asked me which org. to apply the credits on, i se...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- Error: User (role: guests) missing scope...
I want to send a verification code to the user and the given phone number and check it and create a session right after the user entered the secret. For me that...