/** * Mails the forgot password link. * * @param user */ public void mailForgotPasswordLink(U user) { log.debug("Mailing forgot password link to user: " + user); String forgotPasswordCode = greenTokenService.createToken( GreenTokenService.FORGOT_PASSWORD_AUDIENCE, user.getEmail(), properties.getJwt().getExpirationMillis()); // make the link String forgotPasswordLink = properties.getApplicationUrl() + "/reset-password?code=" + forgotPasswordCode; mailForgotPasswordLink(user, forgotPasswordLink); log.debug("Forgot password link mail queued."); }
/** * Mails the forgot password link. * * @param user */ public void mailForgotPasswordLink(U user) { log.debug("Mailing forgot password link to user: " + user); String forgotPasswordCode = greenTokenService.createToken( GreenTokenService.FORGOT_PASSWORD_AUDIENCE, user.getEmail(), properties.getJwt().getExpirationMillis()); // make the link String forgotPasswordLink = properties.getApplicationUrl() + "/reset-password?code=" + forgotPasswordCode; mailForgotPasswordLink(user, forgotPasswordLink); log.debug("Forgot password link mail queued."); }
/** * Mails the change-email verification link to the user. */ protected void mailChangeEmailLink(U user) { String changeEmailCode = greenTokenService.createToken( GreenTokenService.CHANGE_EMAIL_AUDIENCE, user.getId().toString(), properties.getJwt().getExpirationMillis(), LecUtils.mapOf("newEmail", user.getNewEmail())); try { log.debug("Mailing change email link to user: " + user); // make the link String changeEmailLink = properties.getApplicationUrl() + "/users/" + user.getId() + "/change-email?code=" + changeEmailCode; // mail it mailChangeEmailLink(user, changeEmailLink); log.debug("Change email link mail queued."); } catch (Throwable e) { // In case of exception, just log the error and keep silent log.error(ExceptionUtils.getStackTrace(e)); } }
/** * Mails the change-email verification link to the user. */ protected void mailChangeEmailLink(U user) { String changeEmailCode = greenTokenService.createToken( GreenTokenService.CHANGE_EMAIL_AUDIENCE, user.getId().toString(), properties.getJwt().getExpirationMillis(), LecUtils.mapOf("newEmail", user.getNewEmail())); try { log.debug("Mailing change email link to user: " + user); // make the link String changeEmailLink = properties.getApplicationUrl() + "/users/" + user.getId() + "/change-email?code=" + changeEmailCode; // mail it mailChangeEmailLink(user, changeEmailLink); log.debug("Change email link mail queued."); } catch (Throwable e) { // In case of exception, just log the error and keep silent log.error(ExceptionUtils.getStackTrace(e)); } }
/** * Sends verification mail to a unverified user. */ protected void sendVerificationMail(final U user) { try { log.debug("Sending verification mail to: " + user); String verificationCode = greenTokenService.createToken( GreenTokenService.VERIFY_AUDIENCE, user.getId().toString(), properties.getJwt().getExpirationMillis(), LecUtils.mapOf("email", user.getEmail())); // make the link String verifyLink = properties.getApplicationUrl() + "/users/" + user.getId() + "/verification?code=" + verificationCode; // send the mail sendVerificationMail(user, verifyLink); log.debug("Verification mail to " + user.getEmail() + " queued."); } catch (Throwable e) { // In case of exception, just log the error and keep silent log.error(ExceptionUtils.getStackTrace(e)); } }
/** * Sends verification mail to a unverified user. */ protected void sendVerificationMail(final U user) { try { log.debug("Sending verification mail to: " + user); String verificationCode = greenTokenService.createToken(GreenTokenService.VERIFY_AUDIENCE, user.getId().toString(), properties.getJwt().getExpirationMillis(), LecUtils.mapOf("email", user.getEmail())); // make the link String verifyLink = properties.getApplicationUrl() + "/users/" + user.getId() + "/verification?code=" + verificationCode; // send the mail sendVerificationMail(user, verifyLink); log.debug("Verification mail to " + user.getEmail() + " queued."); } catch (Throwable e) { // In case of exception, just log the error and keep silent log.error(ExceptionUtils.getStackTrace(e)); } }