Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification.

NotificationsYou must be signed in to change notification settings

wpcodevo/golang-gorm-postgres

 
 

Repository files navigation

In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification. We will start by registering the user, verifying the user's email address, logging in the registered user, and logging out the authenticated user.

Golang and GORM - User Registration and Email Verification

Topics Covered

  • Golang and GORM JWT Authentication Overview
  • Create the Database Models with GORM
  • Database Migration with GORM
  • Generate and Verify the Password with Bcrypt
  • Sign and Verify the JWT (JSON Web Tokens)
    • Update the Environment Variables File
    • Validate the Variables with Viper
    • Generate the JSON Web Tokens
    • Verify the JSON Web Tokens
  • Create the SMTP Credentials
  • Setup the HTML Templates
    • Add the HTML Email Base Template
    • Add the HTML Email CSS Styles
    • Add the Email Verification Template
    • Create the Email Utility Function
  • Create the Controller Functions
    • Function to Generate the Verification Code
    • User Registration Controller
    • Verify Email Controller
    • Login User Controller
    • Logout User Controller
    • Get User Profile Controller
  • Create the Authentication Guard
  • Create Routes for the Controllers
    • Auth Routes
    • User Routes
  • Register the Routes and Start the Golang Server

Read the entire article here:https://codevoweb.com/golang-and-gorm-user-registration-email-verification

Articles in this series:

1. How to Setup Golang GORM RESTful API Project with Postgres

How to Setup Golang GORM RESTful API Project with Postgres

2. API with Golang + GORM + PostgreSQL: Access & Refresh Tokens

API with Golang + GORM + PostgreSQL: Access & Refresh Tokens

3. Golang and GORM - User Registration and Email Verification

Golang and GORM - User Registration and Email Verification

4. Forgot/Reset Passwords in Golang with SMTP HTML Email

Forgot/Reset Passwords in Golang with SMTP HTML Email

5. Build a RESTful CRUD API with Golang

Build a RESTful CRUD API with Golang

About

In this comprehensive guide, you will learn how to secure a Golang RESTful API with JSON Web Tokens and Email verification.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp