Skip to content

Commit d6ba835

Browse files
authored
Merge pull request #427 from STS-Rosario/login-issues
App fixes
2 parents 69663c9 + 17c4627 commit d6ba835

12 files changed

Lines changed: 154 additions & 102 deletions

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
# API
44
VITE_API_URL="http://carpoolear_backend.test"
5+
# Optional: when building iOS/Android with Capacitor server.hostname matching VITE_API_URL, set a
6+
# different API origin (e.g. www vs apex) so requests are not intercepted by the local bridge.
7+
# VITE_API_URL_NATIVE="https://www.example.com"
58
VITE_WEB_URL="https://carpoolear.com.ar/app"
69

710
# App

.env.production

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Production env vars
22

3-
# API
3+
# API (browser + default)
44
VITE_API_URL="https://carpoolear.com.ar"
5+
# Capacitor WebView uses hostname carpoolear.com.ar (password managers); same-host API calls would
6+
# load index.html from the bridge. Native builds use this host for axios instead:
7+
VITE_API_URL_NATIVE="https://www.carpoolear.com.ar"
58
VITE_WEB_URL="https://carpoolear.com.ar/app"
69

710
# App

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.sts.carpoolear"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 301080
11-
versionName "3.1.8"
10+
versionCode 3010100
11+
versionName "3.1.10"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
aaptOptions {
1414
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.

ios/App/App.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@
357357
CODE_SIGN_IDENTITY = "Apple Development";
358358
CODE_SIGN_STYLE = Automatic;
359359
CURRENT_PROJECT_VERSION = 310;
360-
DEVELOPMENT_TEAM = L3E36EM8LM;
360+
DEVELOPMENT_TEAM = UMLY3ZBABJ;
361361
INFOPLIST_FILE = App/Info.plist;
362362
INFOPLIST_KEY_CFBundleDisplayName = Carpoolear;
363363
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.travel";
364364
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
365365
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
366366
MARKETING_VERSION = 3.1.0;
367367
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
368-
PRODUCT_BUNDLE_IDENTIFIER = com.sts.carpoolear;
368+
PRODUCT_BUNDLE_IDENTIFIER = "com.sts.carpoolear-test";
369369
PRODUCT_NAME = "$(TARGET_NAME)";
370370
PROVISIONING_PROFILE_SPECIFIER = "";
371371
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
Lines changed: 106 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,107 @@
11
{
2-
"images": [
3-
{
4-
"idiom": "ipad",
5-
"size": "20x20",
6-
"scale": "1x",
7-
"filename": "Icon-20x20@1x.png"
8-
},
9-
{
10-
"idiom": "iphone",
11-
"size": "20x20",
12-
"scale": "2x",
13-
"filename": "Icon-20x20@2x.png"
14-
},
15-
{
16-
"idiom": "iphone",
17-
"size": "20x20",
18-
"scale": "3x",
19-
"filename": "Icon-20x20@3x.png"
20-
},
21-
{
22-
"idiom": "iphone",
23-
"size": "29x29",
24-
"scale": "1x",
25-
"filename": "Icon-29x29@1x.png"
26-
},
27-
{
28-
"idiom": "iphone",
29-
"size": "29x29",
30-
"scale": "2x",
31-
"filename": "Icon-29x29@2x.png"
32-
},
33-
{
34-
"idiom": "iphone",
35-
"size": "29x29",
36-
"scale": "3x",
37-
"filename": "Icon-29x29@3x.png"
38-
},
39-
{
40-
"idiom": "iphone",
41-
"size": "40x40",
42-
"scale": "2x",
43-
"filename": "Icon-40x40@2x.png"
44-
},
45-
{
46-
"idiom": "iphone",
47-
"size": "40x40",
48-
"scale": "3x",
49-
"filename": "Icon-40x40@3x.png"
50-
},
51-
{
52-
"idiom": "iphone",
53-
"size": "60x60",
54-
"scale": "2x",
55-
"filename": "Icon-60x60@2x.png"
56-
},
57-
{
58-
"idiom": "iphone",
59-
"size": "60x60",
60-
"scale": "3x",
61-
"filename": "Icon-60x60@3x.png"
62-
},
63-
{
64-
"idiom": "ipad",
65-
"size": "76x76",
66-
"scale": "1x",
67-
"filename": "Icon-76x76@1x.png"
68-
},
69-
{
70-
"idiom": "ipad",
71-
"size": "76x76",
72-
"scale": "2x",
73-
"filename": "Icon-76x76@2x.png"
74-
},
75-
{
76-
"idiom": "ipad",
77-
"size": "83.5x83.5",
78-
"scale": "2x",
79-
"filename": "Icon-83.5@2x.png"
80-
},
81-
{
82-
"idiom": "ios-marketing",
83-
"size": "1024x1024",
84-
"scale": "1x",
85-
"filename": "Icon-marketing-1024x1024.png"
86-
}
87-
],
88-
"info": {
89-
"version": 1,
90-
"author": "apetools.webprofusion.com"
91-
}
92-
}
2+
"images" : [
3+
{
4+
"filename" : "Icon-20x20@2x.png",
5+
"idiom" : "iphone",
6+
"scale" : "2x",
7+
"size" : "20x20"
8+
},
9+
{
10+
"filename" : "Icon-20x20@3x.png",
11+
"idiom" : "iphone",
12+
"scale" : "3x",
13+
"size" : "20x20"
14+
},
15+
{
16+
"filename" : "Icon-29x29@1x.png",
17+
"idiom" : "iphone",
18+
"scale" : "1x",
19+
"size" : "29x29"
20+
},
21+
{
22+
"filename" : "Icon-29x29@2x.png",
23+
"idiom" : "iphone",
24+
"scale" : "2x",
25+
"size" : "29x29"
26+
},
27+
{
28+
"filename" : "Icon-29x29@3x.png",
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "29x29"
32+
},
33+
{
34+
"filename" : "Icon-40x40@2x.png",
35+
"idiom" : "iphone",
36+
"scale" : "2x",
37+
"size" : "40x40"
38+
},
39+
{
40+
"filename" : "Icon-40x40@3x.png",
41+
"idiom" : "iphone",
42+
"scale" : "3x",
43+
"size" : "40x40"
44+
},
45+
{
46+
"filename" : "Icon-60x60@2x.png",
47+
"idiom" : "iphone",
48+
"scale" : "2x",
49+
"size" : "60x60"
50+
},
51+
{
52+
"filename" : "Icon-60x60@3x.png",
53+
"idiom" : "iphone",
54+
"scale" : "3x",
55+
"size" : "60x60"
56+
},
57+
{
58+
"filename" : "Icon-20x20@1x.png",
59+
"idiom" : "ipad",
60+
"scale" : "1x",
61+
"size" : "20x20"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"scale" : "2x",
66+
"size" : "20x20"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"scale" : "2x",
71+
"size" : "29x29"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "2x",
76+
"size" : "40x40"
77+
},
78+
{
79+
"filename" : "Icon-76x76@1x.png",
80+
"idiom" : "ipad",
81+
"scale" : "1x",
82+
"size" : "76x76"
83+
},
84+
{
85+
"filename" : "Icon-76x76@2x.png",
86+
"idiom" : "ipad",
87+
"scale" : "2x",
88+
"size" : "76x76"
89+
},
90+
{
91+
"filename" : "Icon-83.5@2x.png",
92+
"idiom" : "ipad",
93+
"scale" : "2x",
94+
"size" : "83.5x83.5"
95+
},
96+
{
97+
"filename" : "Icon-marketing-1024x1024.png",
98+
"idiom" : "ios-marketing",
99+
"scale" : "1x",
100+
"size" : "1024x1024"
101+
}
102+
],
103+
"info" : {
104+
"author" : "xcode",
105+
"version" : 1
106+
}
107+
}

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export default {
146146
const appVersionInfo = useRootStore().appVersionInfo;
147147
const version = (appVersionInfo && appVersionInfo.version) || (typeof window !== 'undefined' && window.appVersion) || '0';
148148
const base = 'Version ' + version;
149-
return Capacitor.isNativePlatform() ? base : base + ' - build 104';
149+
return Capacitor.isNativePlatform() ? base : base + ' - build 106';
150150
},
151151
...mapState(useCordovaStore, {
152152
deviceReady: 'deviceReady'

src/components/views/Login.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,8 @@ export default {
483483
}
484484
},
485485
onClearClick() {
486-
router.back();
486+
// After failed retoken, login can be the first route — history.back() does nothing.
487+
router.replace({ name: 'trips' });
487488
}
488489
},
489490

src/cordova/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useCordovaStore } from '../stores/cordova';
1111
import { useRootStore } from '../stores/root';
1212

1313
window.facebook = facebook;
14-
window.appVersion = '3.1.8';
14+
window.appVersion = '3.1.10';
1515

1616
function getCordovaStore () {
1717
return useCordovaStore();

src/services/cache/NativeStorage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class NativeStorage {
1818
return (async () => {
1919
const result = await Preferences.get({ key });
2020
if (result.value === null) {
21-
throw new Error('Item not found');
21+
return null;
2222
}
2323

2424
try {

src/stores/auth.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ export const useAuthStore = defineStore('auth', {
182182
resolve();
183183
})
184184
.catch(async () => {
185+
// Stale or invalid token: clear session and open the app as a guest (same as logout).
186+
// Do not send to login — /trips and other routes work without auth; pushing login traps
187+
// users when history is empty (clear / back does nothing).
185188
this.doLogout();
186189
const router = await getLazyRouter();
187-
router.push({ name: 'login' });
190+
router.replace({ name: 'trips' });
188191
resolve();
189192
});
190193
});
@@ -282,6 +285,16 @@ export const useAuthStore = defineStore('auth', {
282285
localConfig.__isLocal = true;
283286
this.setAppConfig(localConfig);
284287
return authApi.config().then((response) => {
288+
const isConfigObject =
289+
response &&
290+
typeof response === 'object' &&
291+
!Array.isArray(response);
292+
if (!isConfigObject) {
293+
console.error(
294+
'getConfig: expected JSON object from /api/config; keeping local config only.'
295+
);
296+
return localConfig;
297+
}
285298
response.__isLocal = false;
286299
console.log('Loading config from server: ', response);
287300
const config = { ...localConfig, ...response };

0 commit comments

Comments
 (0)