Skip to content

Commit

Permalink
Fix oidc error were namespace isnt created juanfont#365
Browse files Browse the repository at this point in the history
  • Loading branch information
kradalby committed Feb 28, 2022
1 parent e7bef56 commit 35616eb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/patrickmn/go-cache"
"github.com/rs/zerolog/log"
"golang.org/x/oauth2"
"gorm.io/gorm"
"tailscale.com/types/key"
)

Expand Down Expand Up @@ -297,7 +296,7 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) {
log.Debug().Msg("Registering new machine after successful callback")

namespace, err := h.GetNamespace(namespaceName)
if errors.Is(err, gorm.ErrRecordNotFound) {
if errors.Is(err, errNamespaceNotFound) {
namespace, err = h.CreateNamespace(namespaceName)

if err != nil {
Expand Down

0 comments on commit 35616eb

Please sign in to comment.