Skip to content

Conversation

@Sajjon
Copy link

@Sajjon Sajjon commented Dec 5, 2025

  • Add makeUrl helper to create URLs in a DRY manner (using elegant KeyPath solution)
  • Add get, getChallengeData, post using KeyPaths
  • Add prepareAuthentication to check rate limit and if we are authenticating currently in a DRY manner
  • Replace Int literal 429 with HTTPStatusCode TooManyRequests

@macroscopeapp
Copy link

macroscopeapp bot commented Dec 5, 2025

Deduplicate networking and preflight checks in PasskeyAuth to DRY registration and login flows in PasskeyAuth.swift

Introduce shared helpers PasskeyAuth.prepareAuthentication, PasskeyAuth.performRequest, PasskeyAuth.get, PasskeyAuth.getChallengeData, PasskeyAuth.post, and PasskeyAuth.makeUrl; update PasskeyAuth.registerPasskey and PasskeyAuth.loginWithPasskey to use them; replace force-unwrapped UTF-8 for userID with Data(UUID().uuidString.utf8); add HTTPStatusCode.tooManyRequests handling.

📍Where to Start

Start with PasskeyAuth.performRequest and PasskeyAuth.post in PasskeyAuth.swift, then review their use in PasskeyAuth.registerPasskey and PasskeyAuth.loginWithPasskey.


Macroscope summarized 154e89b.

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.

1 participant