File tree Expand file tree Collapse file tree 1 file changed +3
-25
lines changed Expand file tree Collapse file tree 1 file changed +3
-25
lines changed Original file line number Diff line number Diff line change @@ -56,31 +56,9 @@ func registerKey(writer http.ResponseWriter, request *http.Request) {
56
56
57
57
func validateKey (writer http.ResponseWriter , request * http.Request ) {
58
58
key := chi .URLParam (request , "key" )
59
- var result bson.D
60
- err := collection .FindOne (context .TODO (), bson.M {"_id" : key }).Decode (& result )
61
- var podcast bson.D
62
- if err = collection .FindOne (context .TODO (), bson.M {"_id" : key }).Decode (& podcast ); err != nil {
59
+ var licenseKey bson.D
60
+ if err := collection .FindOne (context .TODO (), bson.M {"_id" : key }).Decode (& licenseKey ); err != nil {
63
61
log .Fatal (err )
64
62
}
65
- doc , err := bson .Marshal (bson.M {"_id" : key })
66
- fmt .Println (podcast )
67
- var licensekey license.License
68
- err = bson .Unmarshal (doc , & licensekey )
69
- if err != nil {
70
- println (licensekey .Disabled )
71
- return
72
- }
73
-
74
- println (& result )
75
- //for _, licens := range licenses {
76
- // if licens.Key.String() != key {
77
- // continue
78
- // }
79
- //
80
- // err := json.NewEncoder(writer).Encode(licens)
81
- // if err != nil {
82
- // println("Match found for " + key)
83
- // return
84
- // }
85
- //}
63
+ fmt .Println (licenseKey )
86
64
}
You can’t perform that action at this time.
0 commit comments