mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-05 10:22:31 +01:00
oapi: add missing 2fa types to login
This commit is contained in:
parent
0d666732c6
commit
e68819d97a
@ -3997,6 +3997,83 @@
|
||||
"username"
|
||||
]
|
||||
},
|
||||
"TokenResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"$ref": "#/components/schemas/UserSettings"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"settings",
|
||||
"token"
|
||||
]
|
||||
},
|
||||
"MFAResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ticket": {
|
||||
"type": "string"
|
||||
},
|
||||
"mfa": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"sms": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"token": {
|
||||
"type": "null"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mfa",
|
||||
"sms",
|
||||
"ticket",
|
||||
"token"
|
||||
]
|
||||
},
|
||||
"WebAuthnResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"webauthn": {
|
||||
"type": "string"
|
||||
},
|
||||
"ticket": {
|
||||
"type": "string"
|
||||
},
|
||||
"mfa": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
true
|
||||
]
|
||||
},
|
||||
"sms": {
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
"token": {
|
||||
"type": "null"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mfa",
|
||||
"sms",
|
||||
"ticket",
|
||||
"token",
|
||||
"webauthn"
|
||||
]
|
||||
},
|
||||
"ChannelPermissionOverwriteSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -6727,21 +6804,6 @@
|
||||
"$ref": "#/components/schemas/TenorGifResponse"
|
||||
}
|
||||
},
|
||||
"TokenResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"token": {
|
||||
"type": "string"
|
||||
},
|
||||
"settings": {
|
||||
"$ref": "#/components/schemas/UserSettings"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"settings",
|
||||
"token"
|
||||
]
|
||||
},
|
||||
"TokenOnlyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -7163,6 +7225,19 @@
|
||||
"messages"
|
||||
]
|
||||
},
|
||||
"LoginResponse": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/TokenResponse"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/MFAResponse"
|
||||
},
|
||||
{
|
||||
"$ref": "#/components/schemas/WebAuthnResponse"
|
||||
}
|
||||
]
|
||||
},
|
||||
"MemberNickChangeSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -12855,7 +12930,7 @@
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"$ref": "#/components/schemas/TokenResponse"
|
||||
"$ref": "#/components/schemas/LoginResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21795
assets/schemas.json
21795
assets/schemas.json
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@ router.post(
|
||||
requestBody: "LoginSchema",
|
||||
responses: {
|
||||
200: {
|
||||
body: "TokenResponse",
|
||||
body: "LoginResponse",
|
||||
},
|
||||
400: {
|
||||
body: "APIErrorOrCaptchaResponse",
|
||||
|
14
src/util/schemas/LoginResponse.ts
Normal file
14
src/util/schemas/LoginResponse.ts
Normal file
@ -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;
|
Loading…
Reference in New Issue
Block a user