https://supertokens.com/ logo
Title
a

Abhi

01/21/2023, 1:16 PM
Hello team, Does supertokens support google's prompt login. Like login via google without redirection. Where google shows you the login accounts directly on the site.
r

rp

01/21/2023, 1:17 PM
Hey @Abhi
Tagging @sattvikc here. Who can help on Monday
a

Abhi

01/21/2023, 1:17 PM
Sure. Thanks @rp
s

sattvikc

01/23/2023, 5:01 AM
hey @Abhi , I can help you with this. Can you tell me which backend SDK (node, go, python) are you using?
a

Abhi

01/23/2023, 5:17 AM
I am using node
s

sattvikc

01/23/2023, 5:17 AM
cool, I'll share the snippet in a while
Please try this:
r

rp

01/23/2023, 6:47 AM
@Abhi see this please.
a

Abhi

01/23/2023, 7:18 AM
Thank you @sattvikc
s

sattvikc

01/23/2023, 7:22 AM
hey @Abhi I think I misunderstood your question. Did you mean showing google logged in users on the frontend page itself? using the google's js API ?
r

rp

01/23/2023, 7:22 AM
Yea.. thats what they meant @sattvikc
s

sattvikc

01/23/2023, 7:23 AM
cool, will share the snippet in a while
on the backend
for the frontend, use this link to generate the frontend code - https://developers.google.com/identity/gsi/web/tools/configurator
onSignIn callback should be on these lines:
ts
const onSignIn = async function(response: any) {
  try {
    const result = await axios.post('http://localhost:3001/auth/signinup', {
      thirdPartyId: "google",
      redirectURI: "http://localhost:3000",
      authCodeResponse: {
        access_token: 'use-id-token',
        id_token: response.credential,
      }
    })
    // Successful login ...
  } catch (err) {
    // handle error
  }
}
@Abhi let me know if this helps