Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cargo-rustapi/src/templates/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ pub async fn login(Json(body): Json<LoginRequest>) -> Result<Json<LoginResponse>
// TODO: Validate credentials against your database
if body.username == "admin" && body.password == "password" {
let jwt_secret = std::env::var("JWT_SECRET")
.unwrap_or_else(|_| "dev-secret-change-in-production".to_string());
.map_err(|_| ApiError::internal("JWT_SECRET environment variable is not set"))?;
Comment on lines 172 to +173

let claims = UserClaims {
sub: "1".to_string(),
Expand Down
Loading