1
0
mirror of https://github.com/volatiletech/authboss.git synced 2025-02-09 13:47:09 +02:00
authboss/otp/twofactor/twofactor.go
Aaron L 9254c094cf Remove L from two factor recovery codes
- This is a difficult letter to tell apart from the number 1 depending
  on the font. 0 and o should be okay since all letters are lowercase.
2018-12-09 20:27:59 -08:00

51 lines
1.0 KiB
Go

package twofactor
import "github.com/volatiletech/authboss"
// Page constants
const (
PageRecovery2FA = "recovery2fa"
PageVerify2FA = "twofactor_verify"
PageVerifyEnd2FA = "twofactor_verify_end"
)
// Email constants
const (
EmailVerifyHTML = "twofactor_verify_email_html"
EmailVerifyTxt = "twofactor_verify_email_txt"
)
// Form value constants
const (
FormValueToken = "token"
)
// Data constants
const (
DataRecoveryCode = "recovery_code"
DataRecoveryCodes = "recovery_codes"
DataNumRecoveryCodes = "n_recovery_codes"
DataVerifyEmail = "email"
DataVerifyURL = "url"
)
const (
alphabet = "abcdefghijkmnopqrstuvwxyz0123456789"
recoveryCodeLength = 10
verifyEmailTokenSize = 16
)
// User interface
type User interface {
authboss.User
GetEmail() string
PutEmail(string)
// GetRecoveryCodes retrieves a CSV string of bcrypt'd recovery codes
GetRecoveryCodes() string
// PutRecoveryCodes uses a single string to store many
// bcrypt'd recovery codes
PutRecoveryCodes(codes string)
}