Skip to content

StinkyPeach/googleAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

googleAuth

谷歌身份验证器

usage

package main

import (
	"fmt"
)

func main() {

	auth := NewGoogleAuth()
	secret := auth.GetSecret()

	code, err := auth.GetCode(secret)
	url := auth.GetQrcodeUrl("gotest", secret)

	fmt.Println(secret, code, url, err)

	var input string

	for {
		fmt.Scanf("%s", &input)
		fmt.Println(input)

		b, err := auth.VerifyCode(secret, input)
		if err != nil || b == false{
			fmt.Println("failed")
		}else {
			fmt.Println("successful")
		}
	}

}

Releases

No releases published

Packages

No packages published

Languages