AuthEmailBaseEndpoint class abstract
Base endpoint for email-based accounts.
Uses serverpod_auth_session
for session creation upon successful login,
and serverpod_auth_profile
to create profiles for new users upon
registration.
Subclass this in your own application to expose an endpoint including all methods. For further details see https://docs.serverpod.dev/concepts/working-with-endpoints#inheriting-from-an-endpoint-class-marked-abstract Alternatively you can build up your own endpoint on top of the same business logic by using AuthEmail.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- logSessions → bool
-
States if
Session
s should be logged for this endpoint. Defaults to true, override to change.no setterinherited - moduleName → String?
-
The name of the current module, or null for the main server.
no setterinherited
- name → String
-
The name of this
Endpoint
. It will be automatically generated from the name of the class (excluding any Endpoint suffix).no setterinherited - pod → Serverpod
-
The
ServerPod
thisEndpoint
is running on.no setterinherited -
requiredScopes
→ Set<
Scope> -
List of
Scope
s that are required to access thisEndpoint
. Override this getter to setup custom requirements.no setterinherited - requireLogin → bool
-
States if the
Endpoint
only should accept users that are authenticated. Default value is false, override to change.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sendAsRaw → bool
-
If true, returned value from methods will be sent sent to the client
as raw data without any formatting. One use case is to return data through
a non-api call. Defaults to false, override to change. If used, the
endpoint method is responsible for correctly setting the contentType of
the http response (defaults to
text/plain
).no setterinherited - server → Server
-
The
Server
thisEndpoint
is running on.no setterinherited
Methods
-
finishPasswordReset(
Session session, {required UuidValue passwordResetRequestId, required String verificationCode, required String newPassword}) → Future< AuthSuccess> - Completes a password reset request by setting a new password.
-
finishRegistration(
Session session, {required UuidValue accountRequestId, required String verificationCode}) → Future< AuthSuccess> - Completes a new account registration, creating a new auth user with a profile and attaching the given email account to it.
-
getUserObject(
Session session) → dynamic -
Retrieves a custom object associated with this
Endpoint
andSession
.inherited -
handleStreamMessage(
StreamingSession session, SerializableModel message) → Future< void> -
Invoked when a message is sent to this endpoint from the client.
Override this method to create your own custom
StreamingEndpoint
.inherited -
initialize(
Server server, String name, String? moduleName) → void -
Initializes the endpoint with the current
Server
. Typically, this is done from generated code.inherited -
login(
Session session, {required String email, required String password}) → Future< AuthSuccess> - Logs in the user and returns a new session.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendStreamMessage(
StreamingSession session, SerializableModel message) → Future< void> -
Sends an event to the client represented by the
Session
object.inherited -
setUserObject(
Session session, dynamic userObject) → void -
Associate a custom object with this
Endpoint
andSession
.inherited -
startPasswordReset(
Session session, {required String email}) → Future< void> -
Requests a password reset for
email
. -
startRegistration(
Session session, {required String email, required String password}) → Future< void> - Starts the registration for a new user account with an email-based login associated to it.
-
streamClosed(
StreamingSession session) → Future< void> -
Called when a stream was closed.
inherited
-
streamOpened(
StreamingSession session) → Future< void> -
Override this method to setup a new stream when a client connects to the
server.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited