mirror of
https://git.sr.ht/~sircmpwn/tokidoki
synced 2025-12-12 14:17:21 +01:00
Implement IMAP auth provider
This commit is contained in:
parent
96ef5f9b2a
commit
5a641ceca1
7 changed files with 100 additions and 1 deletions
|
|
@ -8,6 +8,8 @@ import (
|
|||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
|
||||
"git.sr.ht/~sircmpwn/tokidoki/auth"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -25,6 +27,10 @@ func main() {
|
|||
mux := chi.NewRouter()
|
||||
mux.Use(middleware.Logger)
|
||||
|
||||
// TODO: Configurable
|
||||
authProvider := auth.NewIMAP("imap.migadu.com:993", true)
|
||||
mux.Use(authProvider.Middleware())
|
||||
|
||||
mux.Get("/", func (w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte("Hello world!\n"))
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue