Authinfo의 Token을 Email로 교체
This commit is contained in:
@ -18,6 +18,17 @@ import (
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type Authinfo struct {
|
||||
Accid primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
|
||||
ServiceCode string `bson:"code" json:"code"`
|
||||
Platform string
|
||||
Uid string
|
||||
Email string
|
||||
Sk primitive.ObjectID
|
||||
RefreshToken string `bson:"refresh_token,omitempty" json:"refresh_token,omitempty"`
|
||||
Expired primitive.DateTime `bson:"_ts" json:"_ts"`
|
||||
}
|
||||
|
||||
const (
|
||||
sessionSyncChannelName = "session-sync-channel2"
|
||||
)
|
||||
|
||||
2
go.mod
2
go.mod
@ -11,6 +11,7 @@ require (
|
||||
github.com/pires/go-proxyproto v0.7.0
|
||||
go.mongodb.org/mongo-driver v1.11.6
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
|
||||
golang.org/x/text v0.3.7
|
||||
)
|
||||
|
||||
require (
|
||||
@ -25,5 +26,4 @@ require (
|
||||
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
)
|
||||
|
||||
12
redis.go
12
redis.go
@ -7,20 +7,8 @@ import (
|
||||
"strconv"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type Authinfo struct {
|
||||
Accid primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"`
|
||||
ServiceCode string `bson:"code" json:"code"`
|
||||
Platform string
|
||||
Uid string
|
||||
Token string
|
||||
Sk primitive.ObjectID
|
||||
RefreshToken string `bson:"refresh_token,omitempty" json:"refresh_token,omitempty"`
|
||||
Expired primitive.DateTime `bson:"_ts" json:"_ts"`
|
||||
}
|
||||
|
||||
func newRedisClient(uri string, dbidxoffset int) *redis.Client {
|
||||
option, err := redis.ParseURL(uri)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user