From c561aa305f31c7bb1a374d3cce1a12641e99bbe5 Mon Sep 17 00:00:00 2001 From: Gustavo Fuhr Date: Mon, 12 Dec 2022 19:29:31 -0300 Subject: [PATCH] new relic debug + new oauth2 endpoints --- packages/webapp/src/classes/client/rest-client/index.ts | 4 ++-- .../webapp/src/components/registration-callback/index.tsx | 2 ++ packages/webapp/src/index.tsx | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/webapp/src/classes/client/rest-client/index.ts b/packages/webapp/src/classes/client/rest-client/index.ts index aa0f3457..50e95028 100644 --- a/packages/webapp/src/classes/client/rest-client/index.ts +++ b/packages/webapp/src/classes/client/rest-client/index.ts @@ -640,7 +640,7 @@ export default class RestClient implements Client { reject: (error: ErrorInfo) => void, ) => { this.axios - .post(`${this.baseUrl}/service/users/googleCallback?code=${code}`, { + .post(`${this.baseUrl}/service/oauth2/googlecallback?code=${code}`, { headers: { 'Content-Type': 'application/json' }, }) .then((response) => { @@ -661,7 +661,7 @@ export default class RestClient implements Client { confirmAccountSync(email: string, code: string): Promise { const handler = (success: () => void, reject: (error: ErrorInfo) => void) => { this.axios - .put(`${this.baseUrl}/service/users/confirmAccountSync?email=${email}&code=${code}`, { + .put(`${this.baseUrl}/service/oauth2/confirmaccountsync?email=${email}&code=${code}`, { headers: { 'Content-Type': 'application/json' }, }) .then(() => { diff --git a/packages/webapp/src/components/registration-callback/index.tsx b/packages/webapp/src/components/registration-callback/index.tsx index 3947b4fd..4b56b932 100644 --- a/packages/webapp/src/components/registration-callback/index.tsx +++ b/packages/webapp/src/components/registration-callback/index.tsx @@ -53,6 +53,7 @@ const RegistrationCallbackPage = (): React.ReactElement => { .catch((error) => { console.log('ERROR', error); setCallbackError(true); + window.newrelic?.noticeError(error); }); }, []); @@ -64,6 +65,7 @@ const RegistrationCallbackPage = (): React.ReactElement => { }) .catch((error) => { console.log('ERROR', error); + window.newrelic?.noticeError(error); }); }; diff --git a/packages/webapp/src/index.tsx b/packages/webapp/src/index.tsx index 9c7b460c..0b0ae125 100644 --- a/packages/webapp/src/index.tsx +++ b/packages/webapp/src/index.tsx @@ -4,6 +4,12 @@ import React from 'react'; import App from './app'; import { createRoot } from 'react-dom/client'; +declare global { + interface Window { + newrelic: { noticeError: (Error) => void }; + } +} + const container = document.getElementById('root') as HTMLElement; const root = createRoot(container!); root.render();