Provider Auth: avoid duplicate device names in ui
This commit is contained in:
parent
6dea5ed21e
commit
e1ca66197c
1 changed files with 2 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"slices"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
|
@ -125,7 +126,7 @@ func NewOauth(ctx context.Context, name, device string, oc *oauth2.Config, opts
|
|||
name: name,
|
||||
}
|
||||
|
||||
if device != "" {
|
||||
if device != "" && !slices.Contains(o.devices, device) {
|
||||
o.devices = append(o.devices, device)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue