Register

KS
Last updated 4 months ago

Allow users to create accounts on your application

Mason Register functions virtually identically to Mason Login, with the exception of Two-Factor Auth.

Registration Fields

Mason Register starts with a form containing common registration fields. See Sending Data to customize this form, and required fields, hidden fields, and validate or modify data before it hits your server.

Example

import React from 'react';
import { Register } from 'mason-library';
class MyRegister extends React.Component {
render() {
return <Register id="YOUR_COMPONENT_ID" willSendData={(data) => {
const { password } = data;
if (password && password.length >= 8) {
return {
...data,
myCustomField: this.props.myCustomField
};
}
return false;
}}
didReceiveData={(data) => {
//do something with user
window.location.href = '/onboarding';
}}
/>
}
}