summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api/routes/auth/login.ts2
-rw-r--r--src/util/schemas/LoginResponse.ts14
2 files changed, 15 insertions, 1 deletions
diff --git a/src/api/routes/auth/login.ts b/src/api/routes/auth/login.ts
index 19a09f81..d3fc1fb4 100644
--- a/src/api/routes/auth/login.ts
+++ b/src/api/routes/auth/login.ts
@@ -40,7 +40,7 @@ router.post(
 		requestBody: "LoginSchema",
 		responses: {
 			200: {
-				body: "TokenResponse",
+				body: "LoginResponse",
 			},
 			400: {
 				body: "APIErrorOrCaptchaResponse",
diff --git a/src/util/schemas/LoginResponse.ts b/src/util/schemas/LoginResponse.ts
new file mode 100644
index 00000000..faf3f769
--- /dev/null
+++ b/src/util/schemas/LoginResponse.ts
@@ -0,0 +1,14 @@
+import { TokenResponse } from "./responses";
+
+export interface MFAResponse {
+	ticket: string;
+	mfa: true;
+	sms: false; // TODO
+	token: null;
+}
+
+export interface WebAuthnResponse extends MFAResponse {
+	webauthn: string;
+}
+
+export type LoginResponse = TokenResponse | MFAResponse | WebAuthnResponse;