1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-23 20:02:22 +00:00

fix issue#500

This commit is contained in:
yangsijie666 2020-04-10 16:02:20 +08:00
parent e60784759f
commit da3bcc2bd2

View File

@ -269,10 +269,10 @@ func (a *Authentication) Auth(ctx context.Context) error {
var appid string
var appkey string
if val, ok := md["login"]; ok { appid = val[0] }
if val, ok := md["user"]; ok { appid = val[0] }
if val, ok := md["password"]; ok { appkey = val[0] }
if appid != a.Login || appkey != a.Password {
if appid != a.User || appkey != a.Password {
return grpc.Errorf(codes.Unauthenticated, "invalid token")
}