example-login-page-with-gin-backend-recaptcha-jwt

command module
v0.0.0-...-e24c920 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2016 License: MIT Imports: 15 Imported by: 0

README

Complete Golang Gin login page with Recaptcha and JWT

Installation

Get your recaptcha keys:

Now you have a "site key" and a "secret key".

On your console, set the environment variables:

$ export RECAPTCHA_SECRET=your-google-recaptcha-secret-key
$ export GLOBAL_SIGNING_KEY=your-supersecret-signing-key
$ export SERVER_DOMAIN=127.0.0.1
$ export SERVER_PORT=:8080 # ":8080" in debug mode; "" in production
$ export SSL_ENABLED=false # false in debug mode; true in production

Inside login.html (line 140), add your site key (data-sitekey) value.

Inside main.go, inside the checkLoginCredentials function, add a call to your db to validate the user and password.

Run

go run main.go

In your browser:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL