mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
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:
parent
d4ef6f52bb
commit
2e424fe249
72 changed files with 1974 additions and 1952 deletions
|
|
@ -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();
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue