Scoped oauth
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user