added cli parameter to toggle registraion, and split the monorepo: now this is only the backend
This commit is contained in:
@@ -50,7 +50,7 @@ pub fn create_jwt(user_uuid: Uuid) -> Result<String, String> {
|
||||
};
|
||||
|
||||
let secret =
|
||||
std::env::var("CHATAPP_JWT_SECRET").unwrap_or_else(|_| DEFAULT_SECRET_KEY.to_string());
|
||||
std::env::var("FRANGIPANE_JWT_SECRET").unwrap_or_else(|_| DEFAULT_SECRET_KEY.to_string());
|
||||
|
||||
encode(
|
||||
&Header::default(),
|
||||
@@ -68,7 +68,7 @@ pub fn verify_jwt(headers: HeaderMap) -> Result<Claims, (StatusCode, String)> {
|
||||
.ok_or((StatusCode::UNAUTHORIZED, "Missing token".to_string()))?;
|
||||
|
||||
let secret =
|
||||
std::env::var("CHATAPP_JWT_SECRET").unwrap_or_else(|_| DEFAULT_SECRET_KEY.to_string());
|
||||
std::env::var("FRANGIPANE_JWT_SECRET").unwrap_or_else(|_| DEFAULT_SECRET_KEY.to_string());
|
||||
|
||||
decode::<Claims>(
|
||||
token,
|
||||
|
||||
Reference in New Issue
Block a user