auth routes

This commit is contained in:
Puyodead1
2023-03-23 10:40:37 -04:00
parent 174d34c376
commit a567ca3f51
25 changed files with 230 additions and 74 deletions

View File

@@ -58,6 +58,7 @@ export * from "./PurgeSchema";
export * from "./RegisterSchema";
export * from "./RelationshipPostSchema";
export * from "./RelationshipPutSchema";
export * from "./responses";
export * from "./RoleModifySchema";
export * from "./RolePositionUpdateSchema";
export * from "./SelectProtocolSchema";

View File

@@ -0,0 +1,6 @@
import { APIErrorResponse } from "./APIErrorResponse";
import { CaptchaRequiredResponse } from "./CaptchaRequiredResponse";
export type APIErrorOrCaptchaResponse =
| CaptchaRequiredResponse
| APIErrorResponse;

View File

@@ -0,0 +1,12 @@
export interface APIErrorResponse {
code: number;
message: string;
errors: {
[key: string]: {
_errors: {
message: string;
code: string;
}[];
};
};
}

View File

@@ -0,0 +1,4 @@
export interface BackupCodesChallengeResponse {
nonce: string;
regenerate_nonce: string;
}

View File

@@ -0,0 +1,5 @@
export interface CaptchaRequiredResponse {
captcha_key: string;
captcha_sitekey: string;
captcha_service: string;
}

View File

@@ -0,0 +1,3 @@
export interface GenerateRegistrationTokensResponse {
tokens: string[];
}

View File

@@ -0,0 +1,5 @@
export interface LocationMetadataResponse {
consent_required: boolean;
country_code: string;
promotional_email_opt_in: { required: true; pre_checked: false };
}

View File

@@ -0,0 +1,6 @@
import { UserSettings } from "../../entities";
export interface TokenResponse {
token: string;
settings: UserSettings;
}

View File

@@ -0,0 +1,7 @@
export * from "./APIErrorOrCaptchaResponse";
export * from "./APIErrorResponse";
export * from "./BackupCodesChallengeResponse";
export * from "./CaptchaRequiredResponse";
export * from "./GenerateRegistrationTokensResponse";
export * from "./LocationMetadataResponse";
export * from "./TokenResponse";