When using Facebook to log in three ways, the valid OAuth jump URI project appears to only support HTTPS access, the local test will implement HTTPS

Mkcert is a small tool which is written in go language to generate local self-license book. It has a series of convenient features, such as cross-platform, easy to use, support multiple domain names, automatic trust CA and so on. It can be used for local development to quickly create HTTPS environment. Making is introduced:…


On macOS, use Homebrew

brew install mkcert
brew install nss # if you use Firefox
$mkcert - Install Created a new local CA 💥 The local CA is now installed in The System Trust Store! ⚡ The local CA is now installed in The Firefox Trust Store (requires Browser Restart)! 🦊 $mkcert" *" example.test localhost ::1 Created a new certificate valid for the Following names 📜 - "" - "" - "" - "example.test" - "localhost" - "" - "::1" The Certificate is at "./" and the key at "./" ✅

Code development: add a middleware

package main import ( "" "" ) func main() { router := gin.Default() Router.use (LoadTls()) // Open port listening router.runtls (":8080", "localhost.pem", "localhost-key.pem") } func LoadTls() gin.HandlerFunc { return func(c *gin.Context) { middleware := secure.New(secure.Options{ SSLRedirect: true, SSLHost: "localhost:8000", }) err := middleware.Process(c.Writer, c.Request) if err ! = nil {// If an error occurs, please do not continue. Fmt.println (err) return} // Continue with ()}}