Updating versions and changing log system
Some checks failed
continuous-integration/drone Build encountered an error

This commit is contained in:
2023-02-20 23:54:02 +01:00
parent 16c57cc424
commit c4a97644ed
14 changed files with 324 additions and 143 deletions

View File

@@ -8,14 +8,18 @@ import (
// RenewalTokenCreate obtain a new renewal token
func (d Db) RenewalTokenCreate(accountID string) (string, error) {
d.Log.Debug("Creating new renewal token", "accountID", accountID)
d.Log.Context = []interface{}{
"accountID", accountID,
}
d.Log.Debug("Creating new renewal token")
newToken := utils.RandString(60)
insertSQL := "INSERT INTO \"renewalTokens\" (\"accountId\",token) VALUES($1,$2);"
_, insertErr := d.DbPool.Exec(context.Background(), insertSQL, accountID, newToken)
if insertErr != nil {
d.Log.Error("Could not insert into database table \"renewalTokens\"", "err", insertErr.Error(), "accountID", accountID)
d.Log.Error("Could not insert into database table \"renewalTokens\"", "err", insertErr.Error())
return "", insertErr
}