Skip to content

Commit

Permalink
Merge pull request #359 from ymaheshwari1/dxp/#272
Browse files Browse the repository at this point in the history
Fixed: login issue in app when /api is not passed with oms complete url by updating the oms-api package and adding a check when accessing url directly in the app(dxp/#272)
  • Loading branch information
ravilodhi authored Mar 14, 2024
2 parents 3ec478c + 129a53a commit 44f2285
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@hotwax/app-version-info": "^1.0.0",
"@hotwax/apps-theme": "^1.2.6",
"@hotwax/dxp-components": "^1.12.1",
"@hotwax/oms-api": "^1.10.0",
"@hotwax/oms-api": "^1.13.0",
"@ionic/core": "^7.6.0",
"@ionic/vue": "^7.6.0",
"@ionic/vue-router": "^7.6.0",
Expand Down
3 changes: 1 addition & 2 deletions src/services/UserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const login = async (username: string, password: string): Promise <any> => {
}

const checkPermission = async (payload: any): Promise <any> => {
let baseURL = store.getters['user/getInstanceUrl'];
baseURL = baseURL && baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`;
const baseURL = store.getters['user/getBaseUrl'];
return client({
url: "checkPermission",
method: "post",
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/user/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getters: GetterTree <UserState, RootState> = {
getBaseUrl (state) {
let baseURL = process.env.VUE_APP_BASE_URL;
if (!baseURL) baseURL = state.instanceUrl;
return baseURL.startsWith('http') ? baseURL : `https://${baseURL}.hotwax.io/api/`;
return baseURL.startsWith('http') ? baseURL.includes('/api') ? baseURL : `${baseURL}/api/` : `https://${baseURL}.hotwax.io/api/`;
},
getUserToken (state) {
return state.token
Expand Down

0 comments on commit 44f2285

Please sign in to comment.