feat: implement under 13 DOB guard and email/password validation route

This commit is contained in:
tdgao
2026-04-17 16:54:44 -06:00
parent a5ccfab01f
commit 2d8c66186c
5 changed files with 146 additions and 73 deletions
@@ -57,6 +57,22 @@ export class LabrinthAuthV2Module extends AbstractModule {
})
}
/**
* Validate email/password inputs for account creation without creating an account.
*
* @param data - Prospective account credentials
*/
public async validateCreateAccount(
data: Labrinth.Auth.v2.ValidateCreateAccountRequest,
): Promise<void> {
return this.client.request(`/auth/create/validate`, {
api: 'labrinth',
version: 2,
method: 'POST',
body: data,
})
}
/**
* Create a new account from an OAuth callback flow state
*
@@ -278,6 +278,12 @@ export namespace Labrinth {
session: string
}
export type ValidateCreateAccountRequest = {
username: string
password: string
email: string
}
export type CreateOAuthAccountRequest = {
username: string
state: string