File tree Expand file tree Collapse file tree
implementations/swift/Sources/StackAuth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -605,30 +605,29 @@ public actor StackClientApp {
605605
606606 // Check if we should return this user
607607 if await user. isAnonymous && !includeAnonymous {
608- return handleNoUser ( or: or)
608+ return try handleNoUser ( or: or)
609609 }
610610
611611 if await user. isRestricted && !effectiveIncludeRestricted {
612- return handleNoUser ( or: or)
612+ return try handleNoUser ( or: or)
613613 }
614614
615615 return user
616616
617617 } catch {
618- return handleNoUser ( or: or)
618+ return try handleNoUser ( or: or)
619619 }
620620 }
621621
622- private func handleNoUser( or: GetUserOr ) -> CurrentUser ? {
622+ private func handleNoUser( or: GetUserOr ) throws -> CurrentUser ? {
623623 switch or {
624624 case . returnNull, . anonymous:
625625 return nil
626626 case . redirect:
627627 // Can't redirect in Swift
628628 return nil
629629 case . throw:
630- // Already thrown
631- return nil
630+ throw UserNotSignedInError ( )
632631 }
633632 }
634633
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ All API requests follow this pattern. This section describes the complete reques
1010### Base URL
1111
1212Construct API URL: ` {baseUrl}/api/v1{path} `
13- - baseUrl defaults to " https://api.stack-auth.com "
13+ - baseUrl defaults to ` https://api.stack-auth.com `
1414 - Remove trailing slash from final URL
1515 - Example: ` https://api.stack-auth.com/api/v1/users/me `
1616
@@ -44,6 +44,7 @@ On 401 response with code="invalid_access_token":
44442 . Fetch new access token using refresh token (see Token Refresh below)
45453 . Retry the request with the new token
46464 . If still 401 after retry: treat as unauthenticated
47+
4748### [ server-only] - Server Key Required
4849
4950Include header: x-stack-secret-server-key: <secretServerKey >
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ Configuration requirements:
127127- Note: The "Client ID" field in the dashboard is for web OAuth (Services ID), not native apps
128128
129129Implementation notes:
130- - The identityToken is a JWT that can be verified using Apple's JWKS (https://appleid.apple.com/auth/keys )
130+ - The identityToken is a JWT that can be verified using Apple's JWKS (` https://appleid.apple.com/auth/keys ` )
131131- The JWT's audience claim must match the configured Bundle ID
132132- User's name and email are only provided on the FIRST authorization; cache if needed
133133- The native flow does NOT use redirect URLs - tokens are returned directly
You can’t perform that action at this time.
0 commit comments