func (h *identityHandlerImpl) IdentityOpsLogin(params identity_ops.IdentityOpsLoginParams) middleware.Responder {
	pbReq := &pb.LoginReq{}
	if err := convert.WithJSON(params.Body, pbReq); err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}

	pbResp, err := h.cli.Login(params.HTTPRequest.Context(), pbReq)
	if err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}

	httpResp := &models.IdentityLoginResp{}
	if err := convert.WithJSON(pbResp, httpResp); err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	tokenType := models.ModelTokenType(pbResp.Token.Type.String())
	httpResp.Token.Type = &tokenType

	rawToken, err := StringifyToken(httpResp.Token)
	if err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	httpResp.Token.Token = rawToken

	return identity_ops.NewIdentityOpsLoginOK().WithPayload(httpResp)
}
/* IdentityOpsLogin Login by email and password. */
IdentityOpsLogin Login by email and password.
/ * IdentityOpsLogin Login by email and password . * /
func (h *identityHandlerImpl) IdentityOpsLogin(params identity_ops.IdentityOpsLoginParams) middleware.Responder {
	pbReq := &pb.LoginReq{}
	if err := convert.WithJSON(params.Body, pbReq); err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	pbResp, err := h.cli.Login(params.HTTPRequest.Context(), pbReq)
	if err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	httpResp := &models.IdentityLoginResp{}
	if err := convert.WithJSON(pbResp, httpResp); err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	tokenType := models.ModelTokenType(pbResp.Token.Type.String())
	httpResp.Token.Type = &tokenType
	rawToken, err := StringifyToken(httpResp.Token)
	if err != nil {
		return errors.NewInternalServerErrorResponseWithErr(err)
	}
	httpResp.Token.Token = rawToken
	return identity_ops.NewIdentityOpsLoginOK().WithPayload(httpResp)
}
func ( h * identityHandlerImpl ) IdentityOpsLogin ( params identity_ops . IdentityOpsLoginParams ) middleware . Responder { pbReq := & pb . LoginReq { } if err := convert . WithJSON ( params . Body , pbReq ) ; err != nil { return errors . NewInternalServerErrorResponseWithErr ( err ) } pbResp , err := h . cli . Login ( params . HTTPRequest . Context ( ) , pbReq ) if err != nil { return errors . NewInternalServerErrorResponseWithErr ( err ) } httpResp := & models . IdentityLoginResp { } if err := convert . WithJSON ( pbResp , httpResp ) ; err != nil { return errors . NewInternalServerErrorResponseWithErr ( err ) } tokenType := models . ModelTokenType ( pbResp . Token . Type . String ( ) ) httpResp . Token . Type = & tokenType rawToken , err := StringifyToken ( httpResp . Token ) if err != nil { return errors . NewInternalServerErrorResponseWithErr ( err ) } httpResp . Token . Token = rawToken return identity_ops . NewIdentityOpsLoginOK ( ) . WithPayload ( httpResp ) }
IdentityOpsLogin Login by email and password.
IdentityOpsLogin Login by email and password .