ITokenCache interface

用戶端的 Token 快取介面,提供快取 API 存取

方法

getAccountByHomeId(string)

回傳已登入且符合 homeAccountId 的帳戶

getAccountByLocalId(string)

回傳已登入的帳號,與 localAccountID 相符

getAllAccounts()

API 會取回目前快取中的所有帳號給使用者

removeAccount(AccountInfo)

API 用來移除特定帳號及相關資料從快取中移除

方法詳細資料

getAccountByHomeId(string)

回傳已登入且符合 homeAccountId 的帳戶

function getAccountByHomeId(homeAccountId: string): Promise<null | AccountInfo>

參數

homeAccountId

string

傳回

Promise<null | AccountInfo>

getAccountByLocalId(string)

回傳已登入的帳號,與 localAccountID 相符

function getAccountByLocalId(localAccountId: string): Promise<null | AccountInfo>

參數

localAccountId

string

傳回

Promise<null | AccountInfo>

getAllAccounts()

API 會取回目前快取中的所有帳號給使用者

function getAllAccounts(): Promise<AccountInfo[]>

傳回

Promise<AccountInfo[]>

removeAccount(AccountInfo)

API 用來移除特定帳號及相關資料從快取中移除

function removeAccount(account: AccountInfo): Promise<void>

參數

account
AccountInfo

傳回

Promise<void>