mirror of
https://github.com/volatiletech/authboss.git
synced 2025-02-09 13:47:09 +02:00
9254c094cf
- 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.
51 lines
1.0 KiB
Go
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)
|
|
}
|