--- title: TB RestClient tags: ThingsBoard --- ## On Flutter ### Issues * 身分管控 * RestClient 的 Token 存於 memory,若要留存登入資訊需藉由 local storage 等 cookie 留存 Token。 1. AuthUser 為直接解析 token 取得而非透過 GET - /api/auth/user。 2. Token 等資訊存於本地端 ( 手機記憶體 ),APP 關閉後清除。 * Web 使用時需注意 1. 先使用 isAuthenticated() 檢查是否有登入資訊。 1. 手動從 cookie 將 token 透過 setUserFromJwtToken() 傳給 RestClient。 2. 使用 isJwtTokenValid() 檢查 token 是否為有效期限內。 3. 若 token expired,使用 refreshJwtToken() 透過 refreshToken 更新 token。 4. 若 refreshToken 也過期,則 RestClient 會將自身的 token & refreshToken 清除。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up