diff --git a/drivers/onedrive/onedrive.go b/drivers/onedrive/onedrive.go index 79102e1e..53a38b9c 100644 --- a/drivers/onedrive/onedrive.go +++ b/drivers/onedrive/onedrive.go @@ -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 }