mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +00:00
Open OAuth URL automatically
This commit is contained in:
parent
e3e5b3cde4
commit
2f3b2cb4f1
1 changed files with 4 additions and 1 deletions
|
|
@ -17,6 +17,8 @@ We also use a custom ``data``-URI for the redirect in OAuth:
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import webbrowser
|
||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from .base import Item, Storage
|
from .base import Item, Storage
|
||||||
|
|
@ -95,7 +97,8 @@ class Session(object):
|
||||||
authorization_url, state = \
|
authorization_url, state = \
|
||||||
self._session.authorization_url(self.endpoints['oauth'])
|
self._session.authorization_url(self.endpoints['oauth'])
|
||||||
|
|
||||||
click.echo('Go to {}'.format(authorization_url))
|
click.echo('Opening {} ...'.format(authorization_url))
|
||||||
|
webbrowser.open(authorization_url)
|
||||||
click.echo('Follow the instructions on the page.')
|
click.echo('Follow the instructions on the page.')
|
||||||
raise exceptions.UserError('Aborted!')
|
raise exceptions.UserError('Aborted!')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue