Skip to content

Commit 02fdd10

Browse files
committed
fix: Return a basic auth client if we flag for basic auth
https://harperdb.atlassian.net/browse/STUDIO-647
1 parent 5abb6f6 commit 02fdd10

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/integrations/api/instance/auth/useInstanceLoginMutation.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ export async function onInstanceLoginSubmit({
4444
}
4545

4646
try {
47+
const auth = {
48+
username,
49+
password,
50+
};
4751
const user = await getInstanceUserInfo({
4852
instanceClient,
49-
auth: {
50-
username,
51-
password,
52-
},
53+
auth,
5354
});
54-
authStore.flagForBasicAuth(entityId, { username, password });
55+
authStore.flagForBasicAuth(entityId, auth);
5556
return {
5657
message,
5758
user,
59+
instanceClient: getInstanceClient({ id: entityId }),
5860
};
5961
} catch (err) {
6062
if (isLocalStudio) {
@@ -74,7 +76,7 @@ export async function onInstanceLoginSubmit({
7476
return {
7577
message,
7678
user,
77-
instanceClient,
79+
instanceClient: fabricInstanceClient,
7880
};
7981
}
8082

src/integrations/api/instance/auth/useInstanceResetPasswordMutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async function onInstanceResetPassword({
4040
if (loginResponse.instanceClient) {
4141
instanceClient = loginResponse.instanceClient;
4242
}
43-
// then we can either alter...
43+
// if the usernames match, we need to alter the user...
4444
if (desiredUsername === defaultClusterUsername) {
4545
await onAlterUser({
4646
username: desiredUsername,

0 commit comments

Comments
 (0)