Fix for bad auth token (#90)
This commit is contained in:
1 parent
d80240130d
commit
a675811488
3 files changed
+12
-1
No files matched your search
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Support playing a video from a specific time (cast from phone, drag and drop, open in Invidious)
|
||||
|
||||
### Fixed
|
||||
|
||||
- A crash where the saved auth token is not in a valid format
|
||||
|
||||
## [0.10.0] - 2023-06-25
|
||||
|
||||
### Added
|
||||
|
||||
@@ -157,6 +157,8 @@ class InvidiousService
|
||||
|
||||
' Public Invidious instances fail a lot randomly, even with valid tokens
|
||||
' For that reason, it's better to make sure the token actually expired by date
|
||||
' TODO: this happens because instance owners do not set hmac_key https://github.com/iv-org/invidious/issues/3854
|
||||
' Once hmac_key is enforced, this check can be removed.
|
||||
function IsTokenMaybeExpired() as dynamic
|
||||
authToken = InvidiousSettings.GetAuthToken()
|
||||
if authToken = invalid
|
||||
|
||||
@@ -39,7 +39,12 @@ namespace InvidiousSettings
|
||||
if tokenPayload = invalid
|
||||
return invalid
|
||||
end if
|
||||
return ParseJson(tokenPayload)
|
||||
authData = ParseJson(tokenPayload)
|
||||
if authData = invalid or authData.instance = invalid or authData.token = invalid
|
||||
RegistryUtils.Delete(RegistryUtils.INVIDIOUS_TOKEN)
|
||||
return invalid
|
||||
end if
|
||||
return authData
|
||||
end function
|
||||
|
||||
function GetBackupInstances() as object
|
||||
|
||||
Reference in new issue
Block a user