Skip to main content

AdminSignupSocialDTO

Package: @nauth-toolkit/core Type: DTO (Request)

Administrative social user import with override capabilities for migrating users from external platforms (e.g., Cognito, Auth0) while preserving social login connections.

import { AdminSignupSocialDTO } from '@nauth-toolkit/nestjs';

Properties

PropertyTypeRequiredDescription
emailstringYesUser email address. Valid email format, max 255 chars. Trimmed and lowercased. Automatically verified for social imports (like normal social signup).
firstNamestringNoFirst name. 1-100 chars. Trimmed.
isPhoneVerifiedbooleanNoBypass phone verification. Default: false.
lastNamestringNoLast name. 1-100 chars. Trimmed.
metadataRecord<string, unknown>NoCustom user metadata.
mustChangePasswordbooleanNoForce password change on first login. Only relevant if password provided. Default: false.
passwordstringNoOptional password for hybrid social+password accounts. Min 8, max 128 chars. Policy enforced.
phonestringNoPhone number in E.164 format (e.g., +14155552671). Max 20 chars.
provider'google' | 'apple' | 'facebook'YesSocial provider name.
providerEmailstringNoEmail from provider's OAuth profile. Max 255 chars. Used for audit/debugging.
providerIdstringYesProvider's unique user ID. Max 255 chars. Must be unique per provider.
socialMetadataRecord<string, unknown>NoRaw OAuth profile data from provider. Stored for debugging/audit.
usernamestringNoUsername. 3-255 chars. Alphanumeric, underscores, hyphens only.

Example

{
"email": "user@example.com",
"provider": "google",
"providerId": "google_12345",
"providerEmail": "user@gmail.com",
"socialMetadata": {
"sub": "google_12345",
"given_name": "John",
"picture": "https://..."
}
}
Email Verification

Email is automatically verified for all social imports (like normal social signup). The isEmailVerified field is not required and is not part of the DTO.

Response

AdminSignupSocialResponseDTO