From 934c978a2cb3820d388e5c01a13979690e02d545 Mon Sep 17 00:00:00 2001 From: Patrik Date: Mon, 23 Jul 2018 20:10:17 +0200 Subject: [PATCH] Returning the internal server so it can be used outside My use case is that we have legacy auth that will be checked first then if that fails we will use the OAuth server. So then I can't really use the HandleTokenVerify, so want to be able to use the `gserver.ValidationBearerToken` directly --- server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index c98cbd1..6da939b 100644 --- a/server.go +++ b/server.go @@ -13,11 +13,12 @@ var ( ) // InitServer Initialize the service -func InitServer(manager oauth2.Manager) { +func InitServer(manager oauth2.Manager) *server.Server { if err := manager.CheckInterface(); err != nil { panic(err) } gServer = server.NewDefaultServer(manager) + return gServer } // HandleAuthorizeRequest the authorization request handling