Your ROOT_URL in app.ini is http://git.slaventius.ru/ but you are visiting http://37.143.12.169/test3k/auth/blame/commit/893e2d392ec15202985f3aa732207a1ce30de28f/internal/transport/grpc/grpc.go
You should set ROOT_URL correctly, otherwise the web may not work correctly.
package db
import (
"context"
"log"
"net"
"strconv"
"git.slaventius.ru/test3k/auth/internal/config"
api "git.slaventius.ru/test3k/umate/pkg/api"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
type AuthDBClient struct {
config * config . Config
client * grpc . ClientConn
db api . AuthDBClient
ctx context . Context
}
func NewDBClient ( ctx context . Context , config * config . Config ) * AuthDBClient {
conStr := net . JoinHostPort ( config . Db . Host , strconv . Itoa ( config . Db . Port ) )
// client, err := grpc.Dial(conStr, grpc.WithInsecure())
client , err := grpc . Dial ( conStr , grpc . WithTransportCredentials ( insecure . NewCredentials ( ) ) )
if err != nil {
log . Fatal ( err )
}
return & AuthDBClient {
config : config ,
client : client ,
db : api . NewAuthDBClient ( client ) ,
ctx : ctx ,
}
}
func ( s * AuthDBClient ) Close ( ) error {
return s . client . Close ( )
}
func ( s * AuthDBClient ) Login ( uid string , password string ) error {
_ , err := s . db . Login ( s . ctx , & api . LoginRequest {
Login : uid ,
Password : password ,
} )
//
if err != nil {
return err
}
return nil
}
func ( s * AuthDBClient ) Registration ( uid string , email string , password string ) ( string , error ) {
res , err := s . db . Registration ( s . ctx , & api . RegistrationRequest {
Login : uid ,
Password : password ,
Email : email ,
} )
//
if err != nil {
return "" , err
}
return res . GetCode ( ) , nil
}
func ( s * AuthDBClient ) Confirmation ( code string ) error {
_ , err := s . db . Confirmation ( s . ctx , & api . ConfirmationRequest {
Code : code ,
} )
//
if err != nil {
return err
}
return nil
}