Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 7c4cf22

Browse files
Nursoltan SaipoldaNursoltan Saipolda
Nursoltan Saipolda
authored and
Nursoltan Saipolda
committed
fix login issue
1 parent f9c08a0 commit 7c4cf22

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

config/dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
TC_NOTIFICATION_URL: "https://api.topcoder-dev.com/v5/notifications",
66
CONNECT_DOMAIN: "https://connect.topcoder-dev.com",
77
COMMUNITY_DOMAIN: "https://www.topcoder-dev.com",
8-
PLATFORM_DOMAIN: "https://local.topcoder-dev.com",
8+
PLATFORM_DOMAIN: "https://platform.topcoder-dev.com",
99
TAAS_APP: "https://platform.topcoder-dev.com/taas/myteams",
1010
},
1111
API: {

src/topcoder-micro-frontends-navbar-app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
setNotificationPlatform,
2121
disableNavigationForRoute,
2222
enableNavigationForRoute,
23+
updateUserProfile,
2324
} from "./utils/exports";
2425

2526
import { login, businessLogin, logout } from "./utils";
@@ -51,5 +52,6 @@ export {
5152
setNotificationPlatform,
5253
disableNavigationForRoute,
5354
enableNavigationForRoute,
55+
updateUserProfile,
5456
PLATFORM,
5557
};

src/utils/exports.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import _ from "lodash";
77
import { bindActionCreators } from "redux";
88
import store from "../store";
9+
import actions from "../actions";
910
import menuActions from "../actions/menu";
1011
import authActions from "../actions/auth";
1112
import notificationActions from "../actions/notifications";
@@ -77,3 +78,18 @@ export const getAuthUserTokens = () => {
7778
});
7879
}
7980
};
81+
82+
/**
83+
* Updates user profile
84+
*/
85+
export const updateUserProfile = (firstName, lastName) => {
86+
const { auth } = store.getState();
87+
88+
const newProfile = {
89+
...auth.profile,
90+
firstName,
91+
lastName,
92+
};
93+
94+
store.dispatch(actions.auth.loadProfile(newProfile || null));
95+
};

src/utils/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import _ from "lodash";
22
import moment from "moment";
33
import config from "../../config";
4-
import { PLATFORM_DOMAIN } from "../constants";
54

65
/**
76
* Generate Logout URL
@@ -35,7 +34,7 @@ export const getBusinessLoginUrl = () =>
3534
*/
3635
export const getSelfServiceLoginUrl = () =>
3736
`${config.URL.AUTH}?retUrl=${encodeURIComponent(
38-
`${PLATFORM_DOMAIN}/self-service`
37+
`${window.location.origin}/self-service`
3938
)}&regSource=tcBusiness&mode=login`;
4039

4140
/**
@@ -45,7 +44,7 @@ export const getSelfServiceLoginUrl = () =>
4544
*/
4645
export const getSelfServiceSignupUrl = () =>
4746
`${config.URL.AUTH}?retUrl=${encodeURIComponent(
48-
`${PLATFORM_DOMAIN}/self-service`
47+
`${window.location.origin}/self-service`
4948
)}&regSource=tcBusiness&mode=signUp`;
5049

5150
/**

0 commit comments

Comments
 (0)