Forum Academy Marketplace Showcase Pricing Features

How to Tell if User Logged in and Temp Code was sent for Oauth2 - API

Hello,

I’m trying to connect my bubble site to a third party application I’m also coding. Currently, the user is able to login through the third party app. When user requests to login, they are redirected to a login page (from bubble site). The redirect url then changes and displays the code needed for the access token. This all works. However, at the moment I don’t know when the user has successfully logged in and so I’m doing two GET requests for the temp code. For now, when the user has logged in and the url changes, I just do another call and extract the temp code. This isn’t a good practice as I have no way of knowing when the user has logged in. Is there a way to check this?

Better yet, is it possible to read the api call response, such that I’m able to recognize when the temp code is sent back. Is there a function that can recognize if the url has changed, or is there a listener I can set up for the pending temp code value?

1 Like

Hi there,

The redirect page can have a “when page is loaded” and that is where you can look in the page URL for the auth code and do the 2nd leg of the OAUTH call to get the tokenn.

Or, if it is not present, show an error.

1 Like