MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / _login

Function _login

dwave/cloud/cli.py:1023–1038  ·  view source on GitHub ↗
(*, config_file, profile, oob, skip_valid, output)

Source from the content-addressed store, hash-verified

1021 skip_valid=skip_valid, output=output)
1022
1023def _login(*, config_file, profile, oob, skip_valid, output):
1024 config = validate_config_v1(load_config(config_file=config_file, profile=profile))
1025
1026 with LeapAuthFlow.from_config_model(config) as flow:
1027 if skip_valid:
1028 if flow.ensure_active_token():
1029 output('Valid token found, skipping authorization.')
1030 return
1031
1032 if oob:
1033 flow.run_oob_flow(open_browser=True)
1034 else:
1035 flow.run_redirect_flow(open_browser=True)
1036
1037 output('Authorization completed successfully. '
1038 'You can now use "dwave auth get" to fetch your token.')
1039
1040
1041@auth.command()

Callers 2

setupFunction · 0.85
loginFunction · 0.85

Calls 7

validate_config_v1Function · 0.90
load_configFunction · 0.90
outputFunction · 0.85
ensure_active_tokenMethod · 0.80
run_oob_flowMethod · 0.80
run_redirect_flowMethod · 0.80
from_config_modelMethod · 0.45

Tested by

no test coverage detected