Create form to request game password change link
Dependencies
- [2]
GZNMGW5MMove footer to separate file - [3]
WVHXYKCVAdd postgresql pools - [4]
WW3KRXX6Add page for reset game password - [5]
BCXEUKX6Add config, static files and web server - [6]
HZDCKIXQUse constants for templates - [7]
HTYEGVBUAdd data to reset password page - [8]
6CFNBL5LAdd headers for better security - [9]
65A3LIWUUse handlebars to render index - [*]
4MZ4VIR7Initial commit - [*]
EVP2FSBHSplit index page
Change contents
- replacement in src/templates/reset-game-pwd.html at line 22
<input name="login" type="text" placeholder="Username" required autofocus /><input name="login" id="login" type="text" placeholder="Username" required autofocus /> - replacement in src/templates/reset-game-pwd.html at line 26
<input name="password" type="password" placeholder="Password" required autofocus /><input name="password" id="password" type="password" placeholder="Password" required autofocus /> - replacement in src/templates/reset-game-pwd.html at line 29
<label for="password">Password:</label><input name="password_copy" type="password" placeholder="Copy password" required autofocus /><label for="password_copy">Password:</label><input name="password_copy" id="password_copy" type="password" placeholder="Copy password" required autofocus /> - replacement in src/templates/query-reset-game-pwd.html at line 12
{{> footer}}<h1>Reset game password</h1><form id="query-reset-game-form" action="query-reset-game-pwd.do" method="post"><fieldset><legend>Enter contact data to request game password change:</legend><div><label for="login">Username:</label><input name="login" id="login" type="text" placeholder="Username" required autofocus /></div><div><input type="radio" name="contact_type" value="email">E-mail<br></div><div><label for="contact">Contact:</label><input name="contact" id="contact" type="text" placeholder="Contact" required autofocus /></div><input name="csrf" type="hidden" value="{{ csrf }}"><input name="submit" type="submit" value="Reset password"></fieldset></form> - edit in src/templates/query-reset-game-pwd.html at line 32
{{> footer}} - edit in src/pages/query_reset_game_pwd.rs at line 1
use actix_web::http::header; - edit in src/pages/query_reset_game_pwd.rs at line 7
use uuid::Uuid;#[derive(serde_derive::Serialize)]struct PageData {csrf: Uuid,}#[derive(serde_derive::Deserialize)]pub struct FormData {login: String,contact_type: String,contact: String,csrf: Uuid,} - replacement in src/pages/query_reset_game_pwd.rs at line 24
let body = match data.handlebars.render(QUERY_RESET_GAME_PWD, &()) {let body = match data.handlebars.render(QUERY_RESET_GAME_PWD,&PageData {csrf: Uuid::new_v4(),},) { - replacement in src/pages/query_reset_game_pwd.rs at line 32
log::error!("Render index error: {}", e);log::error!("Render error: {}", e); - edit in src/pages/query_reset_game_pwd.rs at line 38[3.1059]
#[actix_web::post("/query-reset-game-pwd.do")]pub async fn post_query_reset_game_pwd(form: web::Form<FormData>,data: web::Data<WebData<'_>>,) -> HttpResponse {HttpResponse::Found().append_header((header::LOCATION, "index.html")).finish()} - edit in src/main.rs at line 15[12.423][3.1548]
use pages::query_reset_game_pwd::post_query_reset_game_pwd; - replacement in src/main.rs at line 84
.register_template_string(templates::sub::FOOTER, include_str!("templates/sub/footer.html")).register_template_string(templates::sub::FOOTER,include_str!("templates/sub/footer.html"),) - edit in src/main.rs at line 141
.service(post_query_reset_game_pwd)