fix(ui): more user-friendly message with invalid oauth credentials
@@ -111,8 +111,9 @@ export function useOAuthFlow(
* the API in the document. This cookie will be later used by the BE in the
* redirect page set up in the 3rd party.
*/
+ if (connectResource && connectResource.redirectUrl) {
const popup = window.open(
- connectResource!.redirectUrl,
+ connectResource.redirectUrl,
'Connection popup',
'width=600,height=400,resizable,scrollbars=yes,status=yes'
);
@@ -122,6 +123,12 @@ export function useOAuthFlow(
'error'
);
}
+ } else {
+ pushNotification(
+ `Couldn't connect, check your credentials and try again.`,
+ 'error'
+ );
+ }
} catch (e) {
pushNotification(`Errors trying to connect: ${e.message}`, 'error');
}
