Added user login, logout and creation functionality
Also minor changes to ticketing and AppState
This commit is contained in:
16
backend/src/env.rs
Normal file
16
backend/src/env.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Env {
|
||||
pub db_url: String,
|
||||
pub token_secret: String,
|
||||
}
|
||||
|
||||
impl Env {
|
||||
pub fn load() -> Env {
|
||||
let db_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
|
||||
let token_secret = std::env::var("TOKEN_SECRET").expect("TOKEN_SECRET must be set");
|
||||
Env {
|
||||
db_url,
|
||||
token_secret,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user