fix PAT array split

This commit is contained in:
Pascal Fischer
2023-03-16 16:59:32 +01:00
parent 453643683d
commit 628a201e31
2 changed files with 7 additions and 6 deletions

View File

@@ -1127,8 +1127,8 @@ func (am *DefaultAccountManager) GetAccountFromPAT(token string) (*Account, *Use
if prefix != PATPrefix {
return nil, nil, fmt.Errorf("token invalid")
}
secret := token[len(PATPrefix):len(PATPrefix)]
encodedChecksum := token[34:40]
secret := token[len(PATPrefix) : len(PATPrefix)+PATsecretLength]
encodedChecksum := token[len(PATPrefix)+PATsecretLength : len(PATPrefix)+PATsecretLength+PATChecksumLength]
verificationChecksum, err := base62.Decode(encodedChecksum)
if err != nil {