public interface CustomerService
For additional methods related to the currently authenticated customer,
see Sphere.currentCustomer()
.
Modifier and Type | Method and Description |
---|---|
FetchRequest<Customer> |
byToken(java.lang.String token)
Finds a customer associated to given token.
|
CustomerToken |
createPasswordResetToken(java.lang.String email)
Creates a password reset token for a customer.
|
play.libs.F.Promise<SphereResult<CustomerToken>> |
createPasswordResetTokenAsync(java.lang.String email)
Creates a password reset token for a customer asynchronously.
|
Customer |
resetPassword(VersionedId customerId,
java.lang.String token,
java.lang.String newPassword)
Sets a new password for the current customer.
|
play.libs.F.Promise<SphereResult<Customer>> |
resetPasswordAsync(VersionedId customerId,
java.lang.String token,
java.lang.String newPassword)
Sets a new password for the current customer asynchronously.
|
FetchRequest<Customer> byToken(java.lang.String token)
token
- the tokenCustomerToken createPasswordResetToken(java.lang.String email)
The typical workflow is the following:
byToken
and store customer's id and version
in hidden form fields.
resetPassword
or
resetPasswordAsync
passing in the new password and the token
email
- Email address for which the token should be created.play.libs.F.Promise<SphereResult<CustomerToken>> createPasswordResetTokenAsync(java.lang.String email)
email
- Email address for which the token should be created.createPasswordResetToken
Customer resetPassword(VersionedId customerId, java.lang.String token, java.lang.String newPassword)
token
- A token that was previously generated using the
createPasswordResetToken
method.newPassword
- New plaintext password to be set for the customer.play.libs.F.Promise<SphereResult<Customer>> resetPasswordAsync(VersionedId customerId, java.lang.String token, java.lang.String newPassword)
token
- A token that was previously generated using the
createPasswordResetToken
method.newPassword
- New plaintext password to be set for the customer.