Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Improve Missing Redirect URL Page for Mobile #3930

Closed
2 tasks done
stnguyen90 opened this issue Sep 26, 2022 · 6 comments 路 Fixed by appwrite/console#452
Closed
2 tasks done

馃殌 Feature: Improve Missing Redirect URL Page for Mobile #3930

stnguyen90 opened this issue Sep 26, 2022 · 6 comments 路 Fixed by appwrite/console#452
Labels
product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.

Comments

@stnguyen90
Copy link
Contributor

stnguyen90 commented Sep 26, 2022

馃敄 Feature description

For mobile apps, the default oauth2 page is used to redirect the user back to the mobile app via the appwrite-callback-[PROJECT-ID] URL scheme. The only problem is the Missing Redirect URL page is still shown and visible which can be confusing/annoying to users. It would be nice if the page closes automatically.

馃帳 Pitch

Closing the page automatically would make the flow less confusing and clean up tabs/windows no longer needed. Either that or show a page that says "You may close this page now"

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@stnguyen90 stnguyen90 added product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services. feature labels Sep 26, 2022
@stnguyen90 stnguyen90 removed their assignment Dec 8, 2022
@FernandoUFS
Copy link

For me, not only the page is still open as it redirects back to do a new login on google, even after the log has been executed.

final account = Account(_client); 
await account.createOAuth2Session(
  provider: 'google',      
);
final accountInfo = await account.get();
log('Login done: ' + accountInfo.toMap().toString()); // this code executes right after a successfully login. But the web page is still open

My AndroidManifest.xml has already the setup:

<activity android:name="com.linusu.flutter_web_auth_2.CallbackActivity" android:exported="true">
            <intent-filter android:label="flutter_web_auth_2">
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:scheme="appwrite-callback-63f..............0" />
            </intent-filter>
        </activity>        

@stnguyen90
Copy link
Contributor Author

For me, not only the page is still open as it redirects back to do a new login on google, even after the log has been executed.

@FernandoUFS, it seems you're facing a different problem. Please join us on Discord if you need help troubleshooting.

@samuel-kings
Copy link

Any updates to this issue here yet? Just checking

@leonardodincalci
Copy link

leonardodincalci commented Apr 20, 2023

I also have the problem of missing url error like a flash. Besides this, Can anyone tell me why the value of the variable session is null? The code works, I can log in but the variable remains null.

    @override
  FutureEither<model.Session> loginWithGoogle(
  ) async {
    try {
      final session = await _account.createOAuth2Session(
        provider: 'google',
        success: "",
        failure: "",
      );
      debugPrint(session);
      return right(session);
    } on AppwriteException catch (e, stackTrace) {
      return left(
        Failure(e.message ?? 'Some unexpected error occurred', stackTrace),
      );
    } catch (e, stackTrace) {
      return left(
        Failure(e.toString(), stackTrace),
      );
    }
  }

EDIT: I solved this issue. I removed <model.Session> from FutureEither<model.Session> loginWithGoogle.

@stnguyen90
Copy link
Contributor Author

Perhaps we can update the console page to show a different message if project is included in the query param. For reference, this is the Console code for the "Missing Redirect URL" page: https://github.com/appwrite/console/blob/30f0a3dd84cb914ca345effe6f472bed09776798/src/routes/auth/oauth2/success/%2Bpage.svelte#L10

@stnguyen90
Copy link
Contributor Author

I've been doing some testing and I'm slightly concerned about auto-closing the window/tab because it would trigger a user-canceled exception.

@stnguyen90 stnguyen90 changed the title 馃殌 Feature: Close Missing Redirect URL Page for Mobile 馃殌 Feature: Improve Missing Redirect URL Page for Mobile Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants