1
0
mirror of https://github.com/rclone/rclone.git synced 2025-10-06 05:47:10 +02:00

oauthutil: warn if rclone authorize code can't be decoded #2732

This commit is contained in:
Nick Craig-Wood
2025-08-01 15:37:53 +01:00
parent d4e68bf66b
commit dc78afb1b3

View File

@@ -692,6 +692,10 @@ version recommended):
newFormat := true
err := outM.Decode(code)
if err != nil {
if len(code) > 0 && code[0] != '{' {
fs.Errorf(nil, "Couldn't decode rclone authorize output as base64, trying JSON: %v", err)
fs.Errorf(nil, "Check the code is complete and didn't get truncated >>>%s<<<", code)
}
newFormat = false
err = json.Unmarshal([]byte(code), &token)
}