~lthms/grimoar

364088438ab94e41db2870e666698973392cff88 — Thomas Letan 8 months ago d8ab7cd
Hardcode the private key of sessions in debug mode
1 files changed, 6 insertions(+), 1 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +6 -1
@@ 55,7 55,12 @@ async fn run() -> AnyResult<()> {
    Endpoint::register_to_tera(&mut tera);

    let pool = Pool::builder().build(mngr)?;
    let private_key = rand::thread_rng().gen::<[u8; 32]>();

    let private_key = if cfg!(debug_assertions) {
        [0u8;32]
    } else {
        rand::thread_rng().gen::<[u8; 32]>()
    };

    let secure_cookie = cfg!(debug_assertions);