feat(server): better api error messages (for unhandled exceptions) (#4817)

* feat(server): better error messages

* chore: open api

* chore: remove debug log

* fix: syntax error

* fix: e2e test
This commit is contained in:
Jason Rasmussen 2023-11-03 21:33:15 -04:00 committed by GitHub
parent d4ef6f52bb
commit 2e424fe249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 1974 additions and 1952 deletions

View file

@ -36,23 +36,19 @@ export const oauth = {
authorize: async (location: Location) => {
try {
const redirectUri = location.href.split('?')[0];
const { data } = await api.oauthApi.authorizeOAuth({ oAuthConfigDto: { redirectUri } });
const { data } = await api.oauthApi.startOAuth({ oAuthConfigDto: { redirectUri } });
goto(data.url);
} catch (error) {
handleError(error, 'Unable to login with OAuth');
}
},
getConfig: (location: Location) => {
const redirectUri = location.href.split('?')[0];
return api.oauthApi.generateConfig({ oAuthConfigDto: { redirectUri } });
},
login: (location: Location) => {
return api.oauthApi.callback({ oAuthCallbackDto: { url: location.href } });
return api.oauthApi.finishOAuth({ oAuthCallbackDto: { url: location.href } });
},
link: (location: Location): AxiosPromise<UserResponseDto> => {
return api.oauthApi.link({ oAuthCallbackDto: { url: location.href } });
return api.oauthApi.linkOAuthAccount({ oAuthCallbackDto: { url: location.href } });
},
unlink: () => {
return api.oauthApi.unlink();
return api.oauthApi.unlinkOAuthAccount();
},
};