1 files changed, 26 insertions, 0 deletions
diff --git a/src/dto/auth/WhoAmIDto.js b/src/dto/auth/WhoAmIDto.js
new file mode 100644
index 0000000..ae1795a
--- /dev/null
+++ b/src/dto/auth/WhoAmIDto.js
@@ -0,0 +1,26 @@
+import { SafeNSoundError } from '#util/error.js';
+import Joi from 'joi';
+
+/**
+ * Generic authentication DTO.
+ */
+export class WhoAmIDto {
+ userId;
+ username;
+ deviceId;
+
+ /**
+ * @param data {WhoAmIDto}
+ * @returns {Promise<WhoAmIDto>}
+ */
+ static async create(data) {
+ const obj = new WhoAmIDto();
+ for (const key of Object.keys(data)) {
+ if (key in obj) {
+ obj[key] = data[key];
+ }
+ }
+
+ return obj;
+ }
+}
|