mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +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
|
||||
|
||||
from .base import Item, Storage
|
||||
|
|
@ -95,7 +97,8 @@ class Session(object):
|
|||
authorization_url, state = \
|
||||
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.')
|
||||
raise exceptions.UserError('Aborted!')
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue