-
@Singleton() public final class DropboxAuthDropbox 授权管理器
负责自动刷新和管理用户 Token,并向上层提供统一的授权状态和接口
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<UiState>getTokenStateprivate final StateFlow<String>accessTokenFlowprivate final StateFlow<Boolean>isLoggedInFlowprivate final StateFlow<Boolean>isRefreshFinishedFlow
-
Constructor Summary
Constructors Constructor Description DropboxAuth(DropboxPreferences preferences, DropboxRepository repository, MemoryCacheManager memoryCacheManager)
-
Method Summary
Modifier and Type Method Description final StateFlow<UiState>getGetTokenState()final StateFlow<String>getAccessTokenFlow()final StateFlow<Boolean>getIsLoggedInFlow()final StateFlow<Boolean>getIsRefreshFinishedFlow()final StringgetAuthorizeUrl()获取授权URL final UnitgetToken(String code)授权码换取Token final UnitsaveToken(TokenResponse accessToken)保存Token final Unitlogout()登出并清除所有授权信息 -
-
Constructor Detail
-
DropboxAuth
DropboxAuth(DropboxPreferences preferences, DropboxRepository repository, MemoryCacheManager memoryCacheManager)
-
-
Method Detail
-
getGetTokenState
final StateFlow<UiState> getGetTokenState()
-
getAccessTokenFlow
final StateFlow<String> getAccessTokenFlow()
-
getIsLoggedInFlow
final StateFlow<Boolean> getIsLoggedInFlow()
-
getIsRefreshFinishedFlow
final StateFlow<Boolean> getIsRefreshFinishedFlow()
-
getAuthorizeUrl
final String getAuthorizeUrl()
获取授权URL
-
saveToken
final Unit saveToken(TokenResponse accessToken)
保存Token
-
-
-
-