Add auth info to password reset
Dependencies
- [2]
LTQCLSBUSplit database usage in pages - [3]
4TRDTVC4Fix login page - [4]
HZDCKIXQUse constants for templates - [5]
GZNMGW5MMove footer to separate file - [6]
6CFNBL5LAdd headers for better security - [7]
WLWTNO4YCreate form to request game password change link - [8]
TRBYOQBICheck CSRF and user existence - [*]
FUCFD4UVAdd log in and log out support
Change contents
- replacement in src/templates/query-reset-game-pwd.html at line 9
<div class="navi"></div>{{> header}} - edit in src/templates/login.html at line 28[10.1232][3.50]
<form id="login-mastodon" action="login-mastodon.do" method="post"><fieldset><legend>Social Auth with Mastodon (not yet supported)</legend><div><label for="login">Username:</label><input name="login" id="login" type="text" placeholder="Username" required autofocus /></div><input name="csrf" type="hidden" value="{{ csrf }}"><input name="submit" type="submit" value="Log In"></fieldset></form> - replacement in src/pages/query_reset_game_pwd.rs at line 2
use actix_web::{web, HttpResponse};use actix_web::{web, HttpRequest, HttpResponse}; - edit in src/pages/query_reset_game_pwd.rs at line 4
use crate::pages::insert_security_headers; - edit in src/pages/query_reset_game_pwd.rs at line 5
use crate::pages::{insert_security_headers, request_to_jar, CommonAuthInfo}; - edit in src/pages/query_reset_game_pwd.rs at line 12
common_auth_info: CommonAuthInfo, - replacement in src/pages/query_reset_game_pwd.rs at line 25
pub async fn query_reset_game_pwd(data: web::Data<WebData<'_>>) -> HttpResponse {pub async fn query_reset_game_pwd(request: HttpRequest,data: web::Data<WebData<'_>>,) -> HttpResponse {let jar = request_to_jar(request);let user = jar.private(&data.cookies_key).get("auth").map(|x| x.value().to_string()); - replacement in src/pages/query_reset_game_pwd.rs at line 47
let body = match data.handlebars.render(QUERY_RESET_GAME_PWD, &PageData { csrf }){let body = match data.handlebars.render(QUERY_RESET_GAME_PWD,&PageData {common_auth_info: CommonAuthInfo { user },csrf,},) {