mirror of
https://github.com/modrinth/code.git
synced 2026-08-30 19:46:33 +00:00
feat: implement under 13 DOB guard and email/password validation route
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user