Skip to content

Conversation

Copy link

Copilot AI commented Feb 2, 2026

PR #915 stored wallet_id, nonce, and signature in devices_sessions. This mixed authentication concerns with wallet management and stored redundant data already tracked elsewhere.

Changes

Database schema - devices_sessions now only tracks when devices authenticate:

CREATE TABLE devices_sessions (
    id SERIAL PRIMARY KEY,
    device_id INT NOT NULL REFERENCES devices(id),
    created_at TIMESTAMP NOT NULL DEFAULT current_timestamp
);

Auth guard - Removed wallet lifecycle management:

  • VerifiedAuth no longer includes wallet_id or wallet_identifier
  • Auth guard verifies request, stores session timestamp, returns device + address
  • Wallet operations moved to business logic layer

Referral endpoints - Wallet lookups now where they're needed:

// Before: used pre-computed wallet_identifier from auth
create_username(&request.auth.wallet_identifier, ...)

// After: compute when needed
let wallet_identifier = WalletId::Multicoin(request.auth.address.clone()).id();
create_username(&wallet_identifier, ...)

Net: -29 LOC, cleaner separation of concerns.

Original prompt

#915

we added device authentication now, see how we pass headers, review pr, simplify, only need to store devices and date as created at in db


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@semanticdiff-com
Copy link

Review changes with  SemanticDiff

Copilot AI changed the title [WIP] Add device authentication with headers handling Simplify device authentication: remove wallet tracking from sessions Feb 2, 2026
Copilot AI requested a review from gemcoder21 February 2, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants