can anybody tell me how can I trigger google auth ...
# support-questions-legacy
m
can anybody tell me how can I trigger google auth directly (programatically) instead of clicking the button? Am using pre-built UI and for cordova I need to bypass the need to click the button again.
r
Hey!
You can do that. See the “use your own ui” section about third party login
The first step is to call the getAuthorisationUrlAndSetState function with the thirdPartyId and redirect the user to the resulting url
You should import that function from the auth-react SDK and not the web-js one.
This function fetches the url based on the scopes setting on the backend. It also sets some state in the browser to prevent login CSRF attack
@mib200 see this thread
m
aah... ok
but can't we use anything in default UI?
I know it can be done in own ui
r
You can. You can override the component that shows the default UI and in that useEffect, you can trigger this redirect.
See our docs for react component override (you may need to update to the latest frontend SDK version)
m
hmm
ok