()
| 1832 | |
| 1833 | @app.route("/vault/login", methods=["GET", "POST"]) |
| 1834 | def vault_login(): |
| 1835 | if not vault_configured(): |
| 1836 | return redirect(url_for("vault_setup")) |
| 1837 | if request.method == "POST": |
| 1838 | master = request.form.get("master", "") |
| 1839 | if verify_vault_password(master): |
| 1840 | VAULT_KEYS[get_client_id()] = master |
| 1841 | flash("Vault unlocked.") |
| 1842 | return redirect(url_for("vault_home")) |
| 1843 | flash("Wrong master password.") |
| 1844 | body = """ |
| 1845 | <section class='hero stack'> |
| 1846 | <div class='pillRow'><span class='badge'>Vault locked</span></div> |
| 1847 | <h1 style='margin:0;'>Unlock vault</h1> |
| 1848 | <form method='post' class='grid2'> |
| 1849 | <div class='card stack'><div><label>Master password</label><input type='password' name='master' required></div><div class='row'><button class='btn primary' type='submit'>Unlock</button></div></div> |
| 1850 | <div class='card stack'><h3 style='margin:0;'>What happens here</h3><div class='muted'>Unlock stays only in this local session until you lock it.</div></div> |
| 1851 | </form> |
| 1852 | </section> |
| 1853 | """ |
| 1854 | return render_page("Vault login", body) |
| 1855 | |
| 1856 | @app.route("/vault/logout") |
| 1857 | def vault_logout(): |
nothing calls this directly
no test coverage detected