Skip to content

Commit 7f589e5

Browse files
authored
fxa cli example now has an option for using or ignoring the access token cache (#7356)
1 parent 8e3dd10 commit 7f589e5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

examples/fxa-client/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ enum Command {
6262
/// * This time there shouldn't be a token exchange request, since the refresh token now has
6363
/// the relay scope.
6464
GetAccessToken {
65+
#[arg(long)]
66+
ignore_cache: bool,
6567
scope: String,
6668
},
6769
/// Log in to FxA with the given scopes
@@ -107,9 +109,12 @@ fn main() -> Result<()> {
107109
match command {
108110
Command::Devices(args) => devices::run(account, args)?,
109111
Command::SendTab(args) => send_tab::run(account, args)?,
110-
Command::GetAccessToken { scope } => {
112+
Command::GetAccessToken {
113+
scope,
114+
ignore_cache,
115+
} => {
111116
println!("Requesting access token with scope: {scope}");
112-
let tok = account.get_access_token(&scope, false)?;
117+
let tok = account.get_access_token(&scope, !ignore_cache)?;
113118
println!("Success: {tok:?}");
114119
}
115120
Command::Disconnect => {

0 commit comments

Comments
 (0)