The primaryAddress field of a note contained the internal UUID of the note when no primary alias was defined instead of the public note id.
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2467b125 mistakenly applied the sanitize function
to the log messages *after* the color was applied.
This commit reverses the order to un-break colored logs.
Signed-off-by: David Mehren <git@herrmehren.de>
This tests the ldap part of the authConfig. Other tests shall be added as the auth method is implemented.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
If an empty string or undefined is provided the method should not return [], but undefined instead. This way defaults defined in Joi function as expected.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
The method should only change error messages if it was called with the correct parameters. Otherwise the function would change e.g `.url` in the error message to `_URL` and the regex is not able to change the front of the error message.
Signed-off-by: Philip Molares <philip.molares@udo.edu>
By default, TypeORM wants to NULL the child-side of a
many-to-one relation, when the relation gets deleted.
This is not possible when the column is not nullable,
so the whole row needs to get deleted.
Signed-off-by: David Mehren <git@herrmehren.de>
To keep the createdAt date stable, even when the revisions are dropped,
this adds a separate column
to store this data separately from revisions.
Signed-off-by: David Mehren <git@herrmehren.de>
The primary address is never null.
If no alias is set, the id is returned.
To still easily get the primary alias, the complete Alias DTOs
are now included in the metadata.
Signed-off-by: David Mehren <git@herrmehren.de>
This renames the argument in the POST /profile route to `displayName`
to be more consistent with the UserDTO.
It also adds OpenAPI docs.
Signed-off-by: David Mehren <git@herrmehren.de>
This information is supposed to be used by the frontend
to identify the login method that was used.
The used login method is saved as a string into the session data
and extracted via a new SessionAuthProvider decorator.
Signed-off-by: David Mehren <git@herrmehren.de>
For reasons, during testing, reflect-metadata might not be imported.
This causes the `@Type` annotation to crash the test with a TypeError.
Signed-off-by: David Mehren <git@herrmehren.de>
MariaDB does not support `connect-typeorm`s subqueries,
so they need to be disabled if this dialect is used.
Signed-off-by: David Mehren <git@herrmehren.de>
Previously, the `logout` method immediately returned and did not wait
for the possible error callback.
This wraps the call to `session.destroy` into a promise,
so the error can be properly handled.
Signed-off-by: David Mehren <git@herrmehren.de>
The `validUntil` parameter for `createTokenForUser` may be undefined
in some usages.
As it is easy to add handling for that here, this commit implements it.
Signed-off-by: David Mehren <git@herrmehren.de>