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