Refresh Leap API access token.
(*, config_file, profile, output)
| 1080 | @config_file_options() |
| 1081 | @standardized_output |
| 1082 | def refresh(*, config_file, profile, output): |
| 1083 | """Refresh Leap API access token.""" |
| 1084 | |
| 1085 | config = validate_config_v1(load_config(config_file=config_file, profile=profile)) |
| 1086 | |
| 1087 | with LeapAuthFlow.from_config_model(config) as flow: |
| 1088 | # check we have a token |
| 1089 | if not flow.token or 'refresh_token' not in flow.token: |
| 1090 | raise CLIError('Refresh token not found. Please run "dwave auth login".', code=100) |
| 1091 | |
| 1092 | # refresh |
| 1093 | flow.refresh_token() |
| 1094 | |
| 1095 | output('Access and refresh tokens successfully refreshed. ' |
| 1096 | 'You can now use "dwave auth get" to view them.') |
| 1097 | |
| 1098 | |
| 1099 | @auth.command() |
nothing calls this directly
no test coverage detected