StaticallowedStaticcurrentStaticserializerEither 'sales' or 'lettings'
OptionalplaceId?: string | nullThe search path, e.g. from-3-bed/up-to-5-bed/from-300000/up-to-500000
Retrieves a value from raw API data. Prioritises DBAPI data if available
Special method to define behaviour of JSON.stringify() on model instance
StaticcurrentThis will return the currently signed in user if it is present.
The Session object returned by getServerSession from next-auth must be passed.
StaticpasswordStaticpasswordStaticregisterCreates a new user and corresponding lead. Does not sign the user in.
await User.register({
email: 'myemail@example.com',
password: 'abc123',
passwordConfirmation: 'abc123',
firstName: 'Testuser',
lastName: 'Testuser',
agencyId: 12345,
optInMarketing: false,
optInTerms: true,
});
User registration requires a Bearer token (app verification) via production
users api, regardless of the environement.
This is handled in the users-api-user-helper.ts.
StaticsignCreates a new user session and instantiates and returns a new User.
Returns null if sign in was unsuccessful.
StaticverifyFront end user session verification requires a Bearer token (app verification)
via staging users api if in a staging environment. This differs from other
flows that always require a Bearer token from production, regardless of
environment.
This is handled in the users-api-session-helper.ts.
serializer is a pure function that takes a model instance and returns a plain object that describes how to convert the model to JSON