Skip to content

Commit d161dcd

Browse files
SembaukeNirajn2311
andauthored
chore: update endpoint name for user session retrieval (#1775)
* chore: update endpoint name for user session retrieval * chore: log WebAuthenticationException details on login failure * fix: double app shown in https auth callback in android devices --------- Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
1 parent fbd0a83 commit d161dcd

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

mobile-app/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tool">
2+
xmlns:tools="http://schemas.android.com/tools">
33
<uses-permission android:name="android.permission.INTERNET"/>
44
<uses-permission android:name="android.permission.WAKE_LOCK"/>
55
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
@@ -26,14 +26,6 @@
2626
<action android:name="android.intent.action.MAIN"/>
2727
<category android:name="android.intent.category.LAUNCHER"/>
2828
</intent-filter>
29-
<intent-filter android:autoVerify="true">
30-
<action android:name="android.intent.action.VIEW" />
31-
<category android:name="android.intent.category.DEFAULT" />
32-
<category android:name="android.intent.category.BROWSABLE" />
33-
<data android:scheme="https"
34-
android:host="${auth0Domain}"
35-
android:pathPrefix="/android/${applicationId}/callback" />
36-
</intent-filter>
3729
</activity>
3830
<service android:name="com.ryanheise.audioservice.AudioService"
3931
android:foregroundServiceType="mediaPlayback"

mobile-app/lib/service/authentication/authentication_service.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ class AuthenticationService {
183183
.webAuthentication(scheme: kReleaseMode ? null : 'org.freecodecamp')
184184
.login(useHTTPS: true, parameters: {'connection': connectionType});
185185
}
186-
} on WebAuthenticationException {
186+
} on WebAuthenticationException catch (e) {
187+
188+
log('message: WebAuthenticationException: ${e.message}');
189+
187190
// NOTE: The most likely case is that the user canceled the login
188191
snackbar.showSnackbar(
189192
title: context.t.login_cancelled,
@@ -344,7 +347,7 @@ class AuthenticationService {
344347
late final Response res;
345348
try {
346349
res = await _dio.get(
347-
'$baseApiURL/user/get-session-user',
350+
'$baseApiURL/user/session-user',
348351
options: Options(
349352
headers: {
350353
'CSRF-Token': _csrfToken,

0 commit comments

Comments
 (0)