[go: nahoru, domu]

Skip to content

Commit

Permalink
fix(ui): corrected response data from mfa store action
Browse files Browse the repository at this point in the history
  • Loading branch information
luannmoreira authored and gustavosbarreto committed Apr 30, 2024
1 parent 7b8473c commit b2bfb1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/src/store/modules/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export const auth: Module<AuthState, State> = {

if (resp.status === 200) {
localStorage.setItem("token", resp.data.token || "");
context.commit("mfaToken", resp.data);
context.commit("mfaToken", resp.data.token);
}
} catch (error) {
context.commit("authError");
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/store/modules/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ describe("Auth", () => {

expect(reqSpy).toHaveBeenCalledWith("auth/validateMfa", { code: "000000" });
// Check if the state has been updated correctly
expect(store.getters["auth/stateToken"]).toEqual(validateMfaResponse);
expect(store.getters["auth/stateToken"]).toEqual(validateMfaResponse.token);
});

it("Test recoveryMfa action", async () => {
Expand Down

0 comments on commit b2bfb1a

Please sign in to comment.