[GH-ISSUE #6907] [Bug] Incorrect Redirect URL for Web Login #3059

Closed
opened 2026-03-23 21:27:17 +00:00 by mirror · 6 comments
Owner

Originally created by @indigomado on GitHub (Dec 2, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6907

Originally assigned to: @speed2exe, @qinluhe on GitHub.

Bug Description

When attempting to log in through the web version of AppFlowy using the magic link, the redirect URL in the verification email points to a mobile app URL scheme (appflowy-flutter://). This causes the user to be redirected to the mobile app, which prevents the user from completing the login process on the web platform.

How to Reproduce

  1. On the web platform, input your email and click "Continue".
  2. Open the magic link sent to your email.
  3. The link contains a redirect URL (redirect_to=appflowy-flutter://).
  4. The redirect fails or causes incorrect behavior in the web browser, as the URL is intended for mobile use.

Expected Behavior

The magic link should redirect the user to a web-based login page (e.g., https://yourwebapp.com/login-success), allowing the user to complete the login process on the web platform.

Operating System

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36

AppFlowy Version(s)

0.7.5

Screenshots

No response

Additional Context

No response

Originally created by @indigomado on GitHub (Dec 2, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6907 Originally assigned to: @speed2exe, @qinluhe on GitHub. ### Bug Description When attempting to log in through the web version of AppFlowy using the magic link, the redirect URL in the verification email points to a mobile app URL scheme (appflowy-flutter://). This causes the user to be redirected to the mobile app, which prevents the user from completing the login process on the web platform. ### How to Reproduce 1. On the web platform, input your email and click "Continue". 2. Open the magic link sent to your email. 3. The link contains a redirect URL (redirect_to=appflowy-flutter://). 4. The redirect fails or causes incorrect behavior in the web browser, as the URL is intended for mobile use. ### Expected Behavior The magic link should redirect the user to a web-based login page (e.g., https://yourwebapp.com/login-success), allowing the user to complete the login process on the web platform. ### Operating System Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 ### AppFlowy Version(s) 0.7.5 ### Screenshots _No response_ ### Additional Context _No response_
Author
Owner

@qinluhe commented on GitHub (Dec 3, 2024):

Our cloud will limit the domain name whitelist of front-end applications. For test.appflowy.cloud, it can accept localhost domain names, but beta.appflowy.cloud only accepts appflowy.com domain names. Other domain names that do not meet the requirements will be opened to the client in a unified manner on the backend. Is this logic correct? @speed2exe

<!-- gh-comment-id:2513437007 --> @qinluhe commented on GitHub (Dec 3, 2024): Our cloud will limit the domain name whitelist of front-end applications. For `test.appflowy.cloud`, it can accept `localhost `domain names, but `beta.appflowy.cloud` only accepts `appflowy.com `domain names. Other domain names that do not meet the requirements will be opened to the client in a unified manner on the backend. Is this logic correct? @speed2exe
Author
Owner

@qinluhe commented on GitHub (Dec 3, 2024):

Are you using self hosted or magic link login from appflowy.com?

<!-- gh-comment-id:2513453357 --> @qinluhe commented on GitHub (Dec 3, 2024): Are you using self hosted or magic link login from appflowy.com?
Author
Owner

@indigomado commented on GitHub (Dec 3, 2024):

您是否使用 appflowy.com 的自托管或魔术链接登录?

I conducted local testing and logged into the web app using localhost:3000.

Below are my environment variable settings:

AF_WS_URL=wss://test.appflowy.cloud/ws/v1
AF_BASE_URL=https://beta.appflowy.cloud
AF_GOTRUE_URL=https://beta.appflowy.cloud/gotrue

Let me know if you need any further adjustments!

<!-- gh-comment-id:2513464006 --> @indigomado commented on GitHub (Dec 3, 2024): > 您是否使用 appflowy.com 的自托管或魔术链接登录? I conducted local testing and logged into the web app using localhost:3000. Below are my environment variable settings: AF_WS_URL=wss://test.appflowy.cloud/ws/v1 AF_BASE_URL=https://beta.appflowy.cloud AF_GOTRUE_URL=https://beta.appflowy.cloud/gotrue Let me know if you need any further adjustments!
Author
Owner

@qinluhe commented on GitHub (Dec 3, 2024):

AF_BASE_URL=https://beta.appflowy.cloud/ AF_GOTRUE_URL=https://beta.appflowy.cloud/gotrue to
AF_BASE_URL=https://test.appflowy.cloud/ AF_GOTRUE_URL=https://test.appflowy.cloud/gotrue

beta.appflowy.cloud does not allow localhost access, we restrict web access to the whitelisted *appflowy.com

<!-- gh-comment-id:2513466026 --> @qinluhe commented on GitHub (Dec 3, 2024): `AF_BASE_URL=https://beta.appflowy.cloud/ AF_GOTRUE_URL=https://beta.appflowy.cloud/gotrue` to `AF_BASE_URL=https://test.appflowy.cloud/ AF_GOTRUE_URL=https://test.appflowy.cloud/gotrue` beta.appflowy.cloud does not allow localhost access, we restrict web access to the whitelisted *appflowy.com
Author
Owner

@speed2exe commented on GitHub (Dec 3, 2024):

@MADAOKAKU
The default URL schema is appflowy-flutter://
Due to security reason, only certain URL are valid to be redirected to after authentication, if invalid, it will fallback to this URL.
If you are doing local testing, this is expected.
For testing purposes, after receive the email, you should copy the url, change the redirect_to to http://yourhost/auth/callback

<!-- gh-comment-id:2513473136 --> @speed2exe commented on GitHub (Dec 3, 2024): @MADAOKAKU The default URL schema is `appflowy-flutter://` Due to security reason, only certain URL are valid to be redirected to after authentication, if invalid, it will fallback to this URL. If you are doing local testing, this is expected. For testing purposes, after receive the email, you should copy the url, change the `redirect_to` to `http://yourhost/auth/callback`
Author
Owner

@indigomado commented on GitHub (Dec 3, 2024):

@speed2exe Thank you! I'll close this issue.

<!-- gh-comment-id:2513654354 --> @indigomado commented on GitHub (Dec 3, 2024): @speed2exe Thank you! I'll close this issue.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#3059
No description provided.