Repository navigation
Add identity commands #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,8 +278,25 @@ impl fmt::Display for ApiError { | |
| if let Some(retry) = &self.retry_after { | ||
| write!(f, "; retry after {}", output::safe(retry))?; | ||
| } | ||
| // Identity tokens come from a session, not a login, so signing in again won't help. | ||
| // Only Platform's identity-token errors start this way; other messages may | ||
| // mention identity sessions in passing. | ||
| let identity_session = self.message.starts_with("This identity session"); | ||
| if self.status == StatusCode::UNAUTHORIZED { | ||
| write!(f, "; run `adapt auth login` to sign in again")?; | ||
| if identity_session { | ||
| write!( | ||
| f, | ||
| "; start a new one with `adapt identities sessions start`" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] Explain how to clear the expired token overrideWith exported There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] Explain how to clear the expired token overrideWith exported |
||
| )?; | ||
| } else { | ||
| write!(f, "; run `adapt auth login` to sign in again")?; | ||
| } | ||
| } | ||
| if self.status == StatusCode::FORBIDDEN && identity_session { | ||
| write!( | ||
| f, | ||
| "; an identity session works only in its own organization, so remove --org or ADAPT_ORG_ID" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] Account for the saved organization in the 403 hintRemoving There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] Account for the saved organization in the 403 hintRemoving There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P3] Account for the saved organization in the 403 hintRemoving |
||
| )?; | ||
| } | ||
| if self.code == "ORGANIZATION_REQUIRED" { | ||
| write!(f, "; run `adapt org list` then `adapt org use ID`")?; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P3] Explain how to clear the expired token override
With exported
ADAPT_TOKEN, the recommended session-start command reuses the expired token and returns the same 401. Tell users to unset the override before issuing with their saved browser login.