fix: Fixes migration code incorrectly decoding bcrypt basswords as hex.
All checks were successful
Release code / build (push) Successful in 11m56s

This commit is contained in:
Tera << 8 2024-12-27 09:10:17 -05:00
parent 538c5b6c51
commit c55510eb04
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
3 changed files with 2 additions and 39 deletions

View file

@ -3,7 +3,6 @@ package main
import (
"compress/gzip"
"encoding/base64"
"encoding/hex"
"encoding/json"
"fmt"
"io"
@ -223,18 +222,11 @@ func backupRestoreEntrypoint(cCtx *cli.Context) error {
username = *user.Username
}
bcryptPassword, err := hex.DecodeString(user.Password)
if err != nil {
log.Errorf("Failed to decode hex encoded password: %s", err.Error())
continue
}
userDatabase := &dbcore.User{
Email: user.Email,
Username: username,
Name: user.Name,
Password: base64.StdEncoding.EncodeToString(bcryptPassword),
Password: base64.StdEncoding.EncodeToString([]byte(user.Password)),
IsBot: user.IsBot,
Tokens: tokens,