ProductUserService

@Service
open class ProductUserService

Simple user service for reading and writing ProductUser data. This service is intentionally thin and delegates to ProductUserRepository. It is used by authentication components (e.g. JWT filters and auth controllers) to look up users by id/email/username and to persist new registrations.

Constructors

Link copied to clipboard
@Autowired
constructor(productUserRepository: ProductUserRepository)

Functions

Link copied to clipboard
open fun comparePassword(user: User, password: String): Boolean
Safely compare a plaintext password against the user's stored password.
Link copied to clipboard
open fun getUserByEmail(email: String): ProductUser
Find a ProductUser by email.
Link copied to clipboard
open fun getUserById(id: Long): ProductUser
Fetch a ProductUser by database id.
Link copied to clipboard
open fun getUserByUsername(username: String): ProductUser
Fetch a ProductUser by username.
Link copied to clipboard
open fun saveUser(user: ProductUser)
Persist a ProductUser.
Link copied to clipboard
open fun userExistsByEmail(email: String): Boolean
Check whether a user exists with the given email.
Link copied to clipboard
open fun userExistsByUsername(username: String): Boolean
Check whether a user exists with the given username (case sensitivity depends on repository).