Adding Live 2fa capacity
* Some requests may be sensitive enough to require a secondary two-factor authorization on the spot * Examples: changing password, changing email address, viewing API tokens etc * This creates a core handler that can attach to any Auth-able method which will require a "twofactorcode" query param before processing
This commit is contained in:
@@ -3,6 +3,8 @@ package models
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/yxzzy-wtf/gin-gonic-prepack/database"
|
||||
)
|
||||
|
||||
func TestBadPasswords(t *testing.T) {
|
||||
@@ -75,6 +77,8 @@ func TestTwoFactorWhenNotSet(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTwoFactor(t *testing.T) {
|
||||
database.InitTestDb()
|
||||
|
||||
a := Auth{}
|
||||
a.TwoFactorSecret = "AAAAAAAAAAAAAAAA"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user