MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / vault_login

Function vault_login

Scripts/Developer Base/Free Internet.py:1834–1854  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1832
1833@app.route("/vault/login", methods=["GET", "POST"])
1834def 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")
1857def vault_logout():

Callers

nothing calls this directly

Calls 4

vault_configuredFunction · 0.70
verify_vault_passwordFunction · 0.70
get_client_idFunction · 0.70
render_pageFunction · 0.70

Tested by

no test coverage detected