重置密码
This commit is contained in:
@@ -8,7 +8,8 @@ import (
|
||||
type OperateType int8
|
||||
|
||||
const (
|
||||
OpTypeRegister OperateType = 1 //注册的操作类型
|
||||
OpTypeRegister OperateType = 1 //注册的操作类型
|
||||
OpTypeResetToken OperateType = 2 //重置密码类型
|
||||
)
|
||||
|
||||
type ConfirmationLink[T any] struct {
|
||||
|
||||
@@ -14,15 +14,24 @@ import (
|
||||
|
||||
type RegisterToken struct {
|
||||
OperateType // 操作的类型, 验证的token 必须要继承这个
|
||||
Id int64 // 注册的 id
|
||||
Id int64 // 注册的 id google_id 或 facebook_id ...
|
||||
GuestId uint64 // guest_id 需要继承
|
||||
WId string // websocket 通道id
|
||||
Wid string // websocket 通道id
|
||||
Email string // email
|
||||
Password string // 密码
|
||||
Platform string // 平台
|
||||
CreateAt time.Time // 创建时间
|
||||
}
|
||||
|
||||
type ResetToken struct {
|
||||
OperateType // 操作的类型, 验证的token 必须要继承这个
|
||||
UserId uint64 // guest_id 需要继承
|
||||
Wid string // websocket 通道id
|
||||
Email string // email
|
||||
Password string // 密码
|
||||
CreateAt time.Time // 创建时间
|
||||
}
|
||||
|
||||
func ParseJwtTokenUint64SecretByRequest(r *http.Request, AccessSecret uint64) (jwt.MapClaims, error) {
|
||||
AuthKey := r.Header.Get("Authorization")
|
||||
if AuthKey == "" {
|
||||
|
||||
@@ -11,7 +11,7 @@ func TestGCM(t *testing.T) {
|
||||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WId: 123,
|
||||
Wid: "123",
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
@@ -31,7 +31,7 @@ func BenchmarkCRT(b *testing.B) {
|
||||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WId: 123,
|
||||
Wid: "123",
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
@@ -52,7 +52,7 @@ func BenchmarkGCM(b *testing.B) {
|
||||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WId: 123,
|
||||
Wid: "123",
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
@@ -72,7 +72,7 @@ func TestCRT(t *testing.T) {
|
||||
token := &auth.RegisterToken{
|
||||
OperateType: auth.OpTypeRegister,
|
||||
Password: "fusen_password",
|
||||
WId: 123,
|
||||
Wid: "123",
|
||||
}
|
||||
|
||||
key := "fusen123321"
|
||||
|
||||
Reference in New Issue
Block a user