How did reddit make google auth work without using cookies

Viewed 197

If you disable the cookies, and try to login with google to reddit, it works.

If you're on chrome, you can open an incognito tab (cookies are disabled by default there) and visit this link https://www.reddit.com/login/. Click on continue with google, and the popup will appear.

This doesn't work on other websites like pinterest. Clicking on the google login button doesn't do anything

Also I'm trying to implement google auth in a node app and it doesn't work with cookies disabled. I get the following error:

{error: "idpiframe_initialization_failed", details: "Cookies are not enabled in current environment."}

You can see the same error in the console in reddit, but the auth still works. Anyone has any idea how to work around this?

Some code reference:

gapi.load('auth2', () => {
  gapi.auth2.init({ // The error is thrown by this line
    client_id: 'XXXX',
    scope: 'profile',
  });
});
0 Answers
Related