feat: add payment success redirect (#607)

This commit is contained in:
Zack 2024-06-06 09:56:51 +08:00 committed by GitHub
parent b52369de7f
commit 8a0c098fe8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -18,6 +18,10 @@ pub struct OpenAppFlowyOrDownload {}
#[template(path = "pages/login_callback.html")]
pub struct LoginCallback {}
#[derive(Template)]
#[template(path = "pages/payment_success_redirect.html")]
pub struct PaymentSuccessRedirect {}
#[derive(Template)]
#[template(path = "components/user_usage.html")]
pub struct UserUsage {

View File

@ -28,6 +28,7 @@ fn page_router() -> Router<AppState> {
.route("/", get(home_handler))
.route("/login", get(login_handler))
.route("/login-callback", get(login_callback_handler))
.route("/payment-success", get(payment_success_handler))
.route("/login-callback-query", get(login_callback_query_handler))
.route(
"/open-appflowy-or-download",
@ -67,6 +68,10 @@ async fn login_callback_handler() -> Result<Html<String>, WebAppError> {
render_template(templates::LoginCallback {})
}
async fn payment_success_handler() -> Result<Html<String>, WebAppError> {
render_template(templates::PaymentSuccessRedirect {})
}
async fn login_callback_query_handler(
State(state): State<AppState>,
session: Option<UserSession>,

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>AppFlowy - Redirecting</title>
</head>
<body>
<script type="text/javascript">
window.location.replace("appflowy-flutter://payment-success");
</script>
</body>
</html>