SeafClient icon indicating copy to clipboard operation
SeafClient copied to clipboard

What pattern does SeafSession support for dependency injection?

Open agreentejada opened this issue 1 year ago • 1 comments

Hey Renber,

Great work on this SDK! I've forked it over to my local machine and working to replace our Dropbox service with it. In ASP.NET Core, we injected the DropboxClient object from Dropbox's SDK as a singleton. I assume that the Dropbox SDK managed refreshing the auth token. Does SeafClient also manage the auth token's expiration?

agreentejada avatar Nov 25 '23 23:11 agreentejada

Currently, refreshing of the token is not handled. However, I am not sure how session expiry for username+password based logins is handled in detail on the seafile server (might be automatically extended if you keep using it). In addition, sessions seem to have a rather long lifetime by default (multiple hours?). Consequently, it might be enough to pass the SeafSession instance around.

renber avatar Dec 03 '23 21:12 renber