Skip to main content

Log in a user

Submit the user’s email and password. On success, the SDK caches the access token and attaches it to subsequent protected requests.
The password is wrapped in RedactedString internally — LoginWithPasswordOptions is safe to print or dump, and the SDK never persists the plaintext.
Replace ContentView.swift with:
ContentView.swift

Validate a password (optional)

Your application can require passwords to meet certain rules — for example, a minimum length and a mix of uppercase, lowercase, number, or symbol characters. These rules are configured per application and enforced on both the client and the server. Before submitting a sign-up form, validate the password against the configured rules. The SDK fetches the rules from the server and checks the password locally:
If you already have the rules in hand — for example, fetched once and cached — you can validate without an extra round-trip:
Character classification uses Unicode generalCategory and counts code points, so passwords containing emoji or combining sequences classify consistently.
Replace ContentView.swift with:
ContentView.swift