Add page for reset game password
Dependencies
- [2]
DESUWE7PDelete unused login.do POST page - [3]
EVP2FSBHSplit index page - [4]
BCXEUKX6Add config, static files and web server - [5]
65A3LIWUUse handlebars to render index - [6]
QPHRMBEPGet "Real IP" for proxied build - [7]
7R6HAATPOptional publish static files if use reverse-proxy - [*]
4MZ4VIR7Initial commit - [*]
OJO4B4QOAdd login form and empty handler
Change contents
- file addition: reset-game-pwd.html[4.12]
<!DOCTYPE html><html><head><link rel="alternate" type="application/rss+xml" href="static/rss.xml" title="Multiplayer FreeOrion server news" /><link rel="stylesheet" type="text/css" href="static/style.css" /><title>Reset game password</title></head><body><div class="navi"></div><div class="content"><h1>Reset game password</h1><p><em>Thank you for playing FreeOrion with us.</em><br/><em>Donates are welcome <u>BTC: bc1q04qnmql47zkha6p4edl86hm0wgk90dmsfnl3vl</u></em></p></div></body></html> - file addition: reset_game_pwd.rs[3.17]
use actix_web::http::header;use actix_web::{web, HttpResponse};use handlebars::Handlebars;pub async fn get_reset_game_pwd(hb: web::Data<Handlebars<'_>>) -> HttpResponse {let body = hb.render("reset-game-pwd", &()).expect("render reset-game-pwd");HttpResponse::Ok().body(body)}pub async fn post_reset_game_pwd() -> HttpResponse {HttpResponse::Found().append_header((header::LOCATION, "index.html")).finish()} - edit in src/pages/mod.rs at line 2[3.66]
pub mod reset_game_pwd; - edit in src/main.rs at line 13[3.423][10.94]
use pages::reset_game_pwd::get_reset_game_pwd;use pages::reset_game_pwd::post_reset_game_pwd; - edit in src/main.rs at line 46
.expect("index template");handlebars.register_template_string("reset-game-pwd",include_str!("templates/reset-game-pwd.html"),) - replacement in src/main.rs at line 68
.route("/index.html", web::get().to(index));.route("/index.html", web::get().to(index)).route("/reset-game-pwd-{token}.html",web::get().to(get_reset_game_pwd),).route("/reset-game-pwd.do", web::post().to(post_reset_game_pwd));