| 14 | }; |
| 15 | |
| 16 | bool AuthTable::createUser(const QString& user, const QString& pw) |
| 17 | { |
| 18 | // new salt |
| 19 | QByteArray salt = QCryptographicHash::hash(QUuid::createUuid().toByteArray(), QCryptographicHash::Sha512).toHex(); |
| 20 | QVariantMap map; |
| 21 | map["user"] = user; |
| 22 | map["salt"] = salt; |
| 23 | map["password"] = hashPasswordWithSalt(pw, salt); |
| 24 | map["created_at"] = QDateTime::currentDateTimeUtc().toString(Qt::ISODate); |
| 25 | |
| 26 | VectorPair cond; |
| 27 | cond.append(CPair("user", user)); |
| 28 | return createRecord(cond, map); |
| 29 | } |
| 30 | |
| 31 | void AuthTable::savePipewire(const QString& wToken) |
| 32 | { |
no test coverage detected