nie wiedzieju
This commit is contained in:
@@ -29,10 +29,19 @@ func DeleteGroup(ctx context.Context, chatGroup *ChatGroup) {
|
||||
func CreateClient(ctx context.Context, client *Client) error {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
err := SaveClientWithoutGroups(ctx, client)
|
||||
clients[client.Id] = client
|
||||
|
||||
hashed, err := bcrypt.GenerateFromPassword([]byte(client.PasswordHash), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
client.PasswordHash = string(hashed)
|
||||
|
||||
//err := DbSaveClientWithoutGroups(ctx, client)
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user