no implicit any - force return

add some comments
This commit is contained in:
2021-03-19 19:10:13 +01:00
parent 5dbbd34d3a
commit f2ec5b644d
5 changed files with 7 additions and 32 deletions

View File

@ -24,6 +24,7 @@ func NewCustomStore() oauth2.ClientStore {
func (a *CustomClientStore) GetByID(id string) (oauth2.ClientInfo, error) {
password := settings.GetPassword()
// if password not set assign default password
if password == nil {
defaultpassword := "openmediacenter"
password = &defaultpassword

View File

@ -3,7 +3,6 @@ package oauth
import (
"gopkg.in/oauth2.v3/errors"
"gopkg.in/oauth2.v3/manage"
//"gopkg.in/oauth2.v3/models"
"gopkg.in/oauth2.v3/server"
"gopkg.in/oauth2.v3/store"
"log"
@ -17,18 +16,9 @@ func InitOAuth() {
// token store
manager.MustTokenStorage(store.NewMemoryTokenStore())
//clientStore := store.NewClientStore()
//// todo we need to check here if a password is enabled in db -- when yes set it here!
//clientStore.Set("openmediacenter", &models.Client{
// ID: "openmediacenter",
// Secret: "openmediacenter",
// Domain: "http://localhost:8081",
//})
//
//manager.MapClientStorage(clientStore)
strtest := NewCustomStore()
manager.MapClientStorage(strtest)
// create new secretstore
clientStore := NewCustomStore()
manager.MapClientStorage(clientStore)
srv = server.NewServer(server.NewConfig(), manager)
srv.SetClientInfoHandler(server.ClientFormHandler)