Skip to content

Spring Boot Login and Registration to PostgreSQL Database with Email Verification Api

License

Notifications You must be signed in to change notification settings

afa-farkhod/Spring-Boot-Email-Verification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Spring-Boot-Email-Verification

Spring Boot Login and Registration to PostgreSQL Database with Email Verification Api

  • Scenario: following is the complete backend application for user login and registration using Spring Boot which also includes email verification link. So person comes to register with the firstname, lastname, email and password. Which are then saved on Database. In fact, user gets authorization token back from the server as the proof of registration. Then there goes email verification link to the user's email with the expiration period of 15 minute.

image

  • First we create new Spring project with Spring Initializer by using the IntelliJ IDEA as following:

Image

  • After that, we set required dependencies and Spring Boot version:

Image

  • We run the Spring application first:

image

  • Then with the Postman client we send new user registration request as following:

    image

  • After successful registration, we can check the Database:

image

  • And on Postman we get token from the server as the meaning of successful registration:

image

  • To simulate the email verification part, we use maildev which is the simple way to test project's generated email during development, with an easy to use web interface that runs on local machine built on top of Node.js:
# first clone the GitHub repository
$ git clone https://github.com/maildev/maildev.git
# then run the following command
$ npm install -g maildev
  • Then we can check successful installation by running maildev:

image

  • maildev page looks as following:

image

  • Then when we press the Activate Now , it redirects to the confirmation page:
image

About

Spring Boot Login and Registration to PostgreSQL Database with Email Verification Api

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages