Scoped oauth

This commit is contained in:
Bel LaPointe
2019-11-02 08:03:54 -06:00
parent ba44094eb9
commit 08add4b521
7 changed files with 48 additions and 31 deletions

View File

@@ -3,6 +3,7 @@ package server
import (
"fmt"
"local/oauth2/oauth2server/config"
"local/router"
"net/http"
)
@@ -13,25 +14,25 @@ func (s *Server) Routes() error {
handler http.HandlerFunc
}{
{
path: fmt.Sprintf("authorize"),
path: fmt.Sprintf("authorize/%s", router.Wildcard),
handler: s.authorize,
},
{
path: fmt.Sprintf("verify"),
path: fmt.Sprintf("verify/%s", router.Wildcard),
handler: s.verify,
},
{
path: fmt.Sprintf("users/log"),
path: fmt.Sprintf("users/log/%s", router.Wildcard),
handler: s.usersLog,
},
{
skip: !config.UserRegistration,
path: fmt.Sprintf("users/register"),
path: fmt.Sprintf("users/register/%s", router.Wildcard),
handler: s.usersRegister,
},
{
skip: !config.UserRegistration,
path: fmt.Sprintf("users/submit"),
path: fmt.Sprintf("users/submit/%s", router.Wildcard),
handler: s.usersSubmit,
},
}