Readme and implementation changes
Added optional auth url callback Removed user pass from readme Added oauth to readme
This commit is contained in:
@@ -1596,10 +1596,16 @@ class Session(Closeable, MessageListener, SubListener):
|
||||
pass
|
||||
return self
|
||||
|
||||
def oauth(self) -> Session.Builder:
|
||||
def oauth(self, oauth_url_callback) -> Session.Builder:
|
||||
"""
|
||||
Login via OAuth
|
||||
|
||||
You can supply an oauth_url_callback method that takes a string and returns the OAuth URL.
|
||||
When oauth_url_callback is None, this will block until logged in.
|
||||
"""
|
||||
if os.path.isfile(self.conf.stored_credentials_file):
|
||||
return self.stored_file(None)
|
||||
self.login_credentials = OAuth(MercuryRequests.keymaster_client_id, "http://127.0.0.1:5588/login").flow()
|
||||
self.login_credentials = OAuth(MercuryRequests.keymaster_client_id, "http://127.0.0.1:5588/login", oauth_url_callback).flow()
|
||||
return self
|
||||
|
||||
def user_pass(self, username: str, password: str) -> Session.Builder:
|
||||
|
||||
Reference in New Issue
Block a user