feat: add payment success redirect (#607)
This commit is contained in:
parent
b52369de7f
commit
8a0c098fe8
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
Loading…
Reference in New Issue