Package com.codename1.backend.security.mail


package com.codename1.backend.security.mail

What a server does by mail on a user's behalf: resetting a forgotten password and proving that an address is theirs.

Both mail a link carrying a token from OneTimeTokenService: 256 random bits that work once, for one purpose, until they expire. Only the token's SHA-256 is kept, so a copy of the table opens nothing.

  • PasswordResetService mails the link and sets the new password; http.passwordReset(...) adds the two pages in front of it.
  • EmailVerificationService mails the link and records the address as proved; http.emailVerification(...) adds the address the link opens.

A code mailed as a second factor at sign-in is EmailCodeService.

Everything here sends through MailSender, so it goes wherever cn1.mail.url says, and a test reads what was sent from MailSender.sent().