no implicit any - force return
add some comments
This commit is contained in:
@ -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
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user