Skip to content

Commit

Permalink
upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
bolkedebruin committed Mar 18, 2024
1 parent f70348c commit 46620c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions cmd/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package main
import (
"context"
"errors"
"fmt"
"github.com/bolkedebruin/rdpgw/shared/auth"
"github.com/msteinert/pam"
"github.com/msteinert/pam/v2"
"github.com/thought-machine/go-flags"
"google.golang.org/grpc"
"log"
Expand Down Expand Up @@ -52,7 +53,13 @@ func (s *AuthServiceImpl) Authenticate(ctx context.Context, message *auth.UserPa
r.Error = err.Error()
return r, err
}

defer func() {
err := t.End()
if err != nil {
fmt.Fprintf(os.Stderr, "end: %v\n", err)
os.Exit(1)
}
}()
if err = t.Authenticate(0); err != nil {
log.Printf("Authentication for user: %s failed due to: %s", message.Username, err)
r.Error = err.Error()
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ require (
github.com/knadh/koanf/providers/env v0.1.0
github.com/knadh/koanf/providers/file v0.1.0
github.com/knadh/koanf/v2 v2.1.0
github.com/msteinert/pam v1.2.0
github.com/msteinert/pam/v2 v2.0.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/prometheus/client_golang v1.19.0
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.9.0
github.com/thought-machine/go-flags v1.6.3
golang.org/x/crypto v0.21.0
golang.org/x/oauth2 v0.18.0
Expand Down

0 comments on commit 46620c8

Please sign in to comment.