untie session id to saved aliases

This commit is contained in:
Carlosokumu 2025-01-23 12:05:23 +03:00
parent 4ae0a484f4
commit 448fdffbd0
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -346,17 +346,13 @@ func (das *DevAccountService) saveAlias(ctx context.Context, alias map[string]st
if das.db == nil {
return fmt.Errorf("Db cannot be nil")
}
sessionId, ok := ctx.Value("SessionId").(string)
if !ok {
return fmt.Errorf("unresolved session id")
}
for k, v := range alias {
k_ := das.prefixKeyFor("alias", k)
v_, err := json.Marshal(v)
if err != nil {
return err
}
das.db.SetSession(sessionId)
das.db.SetSession("")
das.db.SetPrefix(db.DATATYPE_USERDATA)
return das.db.Put(ctx, []byte(k_), v_)
}