initial commit
This commit is contained in:
commit
5a75f99720
20 changed files with 2239 additions and 0 deletions
27
backend/routes/auth/routes.go
Normal file
27
backend/routes/auth/routes.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package auth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"gitlab.com/1f320/pronouns/backend/server"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
*server.Server
|
||||
}
|
||||
|
||||
func Mount(srv *server.Server, r chi.Router) {
|
||||
s := &Server{srv}
|
||||
_ = s
|
||||
|
||||
r.Route("/auth/discord", func(r chi.Router) {
|
||||
r.Get("/authorize", nil) // generate csrf token, returns URL
|
||||
r.Get("/callback", nil) // takes code + state, validates it, returns token OR discord signup ticket
|
||||
r.Get("/signup", nil) // takes discord signup ticket to register account
|
||||
|
||||
r.Get("/test", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("hello world!"))
|
||||
})
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue