This commit is contained in:
parent
cb0806f690
commit
29cf990363
2 changed files with 5 additions and 5 deletions
|
@ -15,7 +15,7 @@ impl CSRF for User {
|
|||
///
|
||||
/// This is useful for htmx requests to update the CSRF token in place.
|
||||
async fn update_csrf(&self) -> PreEscaped<String> {
|
||||
html! { script { (format!("document.getElementById('csrf').value = '{}';", self.get_csrf().await)) }; }
|
||||
html! { script { (format!("document.querySelectorAll('.csrf').forEach(element => {{ element.value = '{}'; }});", self.get_csrf().await)) }; }
|
||||
}
|
||||
|
||||
/// Get CSRF Token for the current session
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue