Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/authDB/commit/8695307a455738d235e79b546bb85c3a7c594f7d?style=unified&whitespace=ignore-change
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
17 additions and
6 deletions
.vscode/launch.json
internal/transport/grpc/grpc.go
@ -13,7 +13,7 @@
"env" : {
/ / "DB_HOST" : "127.0.0.1" ,
/ / "DB_PORT" : "9055" ,
"APP_PORT" : "9056 " ,
"APP_PORT" : "9995 " ,
} ,
"args" : [ ]
}
@ -41,17 +41,23 @@ func (s *authDBServer) Login(ctx context.Context, req *api.LoginRequest) (*api.L
//
user , ok := s . users [ req . GetLogin ( ) ]
if ! ok {
return nil , errors . New ( "login unknown" )
return & api . LoginResponse {
ID : 0 ,
} , errors . New ( "login unknown" )
}
//
if ! user . Confirmed {
return nil , errors . New ( "login unconfirmed" )
return & api . LoginResponse {
ID : 0 ,
} , errors . New ( "login unconfirmed" )
}
//
if user . Password != req . Password {
return nil , errors . New ( "password incorrect" )
return & api . LoginResponse {
ID : 0 ,
} , errors . New ( "password incorrect" )
}
return & api . LoginResponse {
@ -64,9 +70,14 @@ func (s *authDBServer) Registration(ctx context.Context, req *api.RegistrationRe
defer s . mu . Unlock ( )
//
_ , ok := s . users [ req . GetLogin ( ) ]
val , ok := s . users [ req . GetLogin ( ) ]
if ok {
return nil , errors . New ( "login already registered" )
user := & api . RegistrationResponse {
Code : val . Code ,
Email : val . Email ,
}
return user , errors . New ( "login already registered" )
}
//