protondrive: handle the empty credential case when reading from the config cache
This commit is contained in:
parent
77f7bb08af
commit
d01d57e62f
1 changed files with 16 additions and 0 deletions
|
@ -271,18 +271,34 @@ func getConfigMap(m configmap.Mapper) (uid, accessToken, refreshToken, saltedKey
|
|||
if accessToken, ok = m.Get(clientAccessTokenKey); !ok {
|
||||
return
|
||||
}
|
||||
if len(accessToken) == 0 {
|
||||
ok = false
|
||||
return
|
||||
}
|
||||
|
||||
if uid, ok = m.Get(clientUIDKey); !ok {
|
||||
return
|
||||
}
|
||||
if len(uid) == 0 {
|
||||
ok = false
|
||||
return
|
||||
}
|
||||
|
||||
if refreshToken, ok = m.Get(clientRefreshTokenKey); !ok {
|
||||
return
|
||||
}
|
||||
if len(refreshToken) == 0 {
|
||||
ok = false
|
||||
return
|
||||
}
|
||||
|
||||
if saltedKeyPass, ok = m.Get(clientSaltedKeyPassKey); !ok {
|
||||
return
|
||||
}
|
||||
if len(saltedKeyPass) == 0 {
|
||||
ok = false
|
||||
return
|
||||
}
|
||||
_saltedKeyPass = saltedKeyPass
|
||||
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue