mirror of https://github.com/Xhofe/alist
🐛 fix empty refresh_token
parent
fe79f9518b
commit
b2055777e0
|
@ -1,6 +1,7 @@
|
|||
package onedrive
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/Xhofe/alist/conf"
|
||||
"github.com/Xhofe/alist/drivers/base"
|
||||
|
@ -93,6 +94,10 @@ func (driver Onedrive) RefreshToken(account *model.Account) error {
|
|||
} else {
|
||||
account.Status = "work"
|
||||
}
|
||||
if resp.RefreshToken == "" {
|
||||
account.Status = "empty refresh_token"
|
||||
return errors.New("empty refresh_token")
|
||||
}
|
||||
account.RefreshToken, account.AccessToken = resp.RefreshToken, resp.AccessToken
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue