Skip to content

Commit 70785b0

Browse files
committed
trim token spaces
1 parent 000b030 commit 70785b0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

session/ssh_session.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"io"
88
"net"
99
"strconv"
10+
"strings"
1011

1112
"github.com/garyburd/redigo/redis"
1213
"github.com/prometheus/client_golang/prometheus"
@@ -240,7 +241,7 @@ func (s *SSHSession) Close() {
240241
}
241242

242243
func (s *SSHSession) authFromToken(c ssh.ConnMetadata, pass []byte) (*ssh.Permissions, error) {
243-
backendID, err := s.store.BackendIDFromToken(string(pass))
244+
backendID, err := s.store.BackendIDFromToken(strings.TrimSpace(string(pass)))
244245
if err != nil && err != redis.ErrNil {
245246
return nil, err
246247
}

0 commit comments

Comments
 (0)