Skip to content

Commit 52a9c23

Browse files
ilblackdragonclaude
authored andcommitted
refactor: remove GATEWAY_USER_TOKENS, fix review feedback
GATEWAY_USER_TOKENS never went to production — replaced entirely by DB-backed user management via /api/admin/users and /api/tokens. Removed: - UserTokenConfig struct and GATEWAY_USER_TOKENS env var parsing - user_tokens field from GatewayConfig - GatewayChannel::new_multi_auth() constructor - Env-var user migration block in main.rs (~90 lines) - multi_tenant auto-detection from GATEWAY_USER_TOKENS (now runtime via db.has_any_users() in app.rs) Review fixes (zmanian): - User ID generation: UUID instead of display-name derivation (#1) - Invitation accept moved to public router (no auth needed) (#3) - libSQL get_invitation_by_hash aligned with postgres: filters status='pending' AND expires_at > now (#4) - UUID parse: returns DatabaseError::Serialization instead of unwrap_or_default (#7) - PostgreSQL SELECT * replaced with explicit column lists (#8) - Sort order aligned (both backends use DESC) (#6) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9e72d38 commit 52a9c23

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/channels/web/handlers/invitations.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,7 @@ pub async fn invitations_accept_handler(
162162
return Err((StatusCode::GONE, "Invitation has expired".to_string()));
163163
}
164164

165-
// Generate a user id from the display name.
166-
let new_user_id = display_name
167-
.to_ascii_lowercase()
168-
.split_whitespace()
169-
.collect::<Vec<_>>()
170-
.join("-");
165+
let new_user_id = Uuid::new_v4().to_string();
171166

172167
let now = chrono::Utc::now();
173168
let user_record = UserRecord {

0 commit comments

Comments
 (0)