Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seacat Auth API refactoring #42

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

byewokko
Copy link
Collaborator

@byewokko byewokko commented Nov 16, 2023

Strict dependency on TeskaLabs/seacat-auth/pull/319. UI will not work with older Seacat Admin API versions.

Sync merge with

Breaking changes

  • Seacat Account management endpoints are now prefixed with /account
  • Path /public/login.prologue changed to /public/login-prologue

@byewokko byewokko added enhancement New feature or request breaking change This will introduce a breaking change labels Nov 16, 2023
@byewokko byewokko self-assigned this Nov 16, 2023
@byewokko byewokko requested a review from Pe5h4 November 19, 2023 13:57
@@ -43,7 +43,7 @@ function ManageEmailCard(props) {
let redirect_uri = params.get("redirect_uri");

let history = useHistory();
let SeaCatAuthAPI = props.app.axiosCreate('seacat-auth');
let SeaCatAccountAPI = props.app.axiosCreate('seacat-auth/account');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@byewokko I dont think this is a good way to do this. Here should be just a service name. So only seacat-auth here should be correct.

This is the correct way:

response = await SeaCatAccountAPI.put("/account/credentials", ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea was to have a separate axios instance for login and auth stuff (seacat-auth/public) and another one for the account management (seacat-auth/account). they now even have different authorization and ports on backend. i wanted to make this separation clear in the code:

let SeaCatAccountAPI = props.app.axiosCreate('seacat-auth/account');
let SeaCatPublicAPI = props.app.axiosCreate('seacat-auth/public');

but maybe it is not necessary. what does @ateska think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed: Franta is right. There is no need for separation, also the proposed changes would make the code harder to search and correlate with the nginx config. So the correct approach is this:

let SeaCatAuthAPI = props.app.axiosCreate('seacat-auth');
...
response = await SeaCatAuthAPI.put("/account/credentials", ...)

@byewokko byewokko requested a review from ateska November 20, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This will introduce a breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants