auto logout

This commit is contained in:
Sas Andy
2024-12-12 09:53:29 +07:00
parent ecc5dfd9c0
commit 66333ea727
13 changed files with 611 additions and 23 deletions

View File

@@ -12,15 +12,17 @@ import (
)
type Handler struct {
store types.DoctorStore
store types.DoctorStore
authStore types.OauthStore
}
func NewHandler(store types.DoctorStore) *Handler {
return &Handler{store: store}
func NewHandler(store types.DoctorStore, authStore types.OauthStore) *Handler {
return &Handler{store: store, authStore: authStore}
}
func (h *Handler) RegisterRoutes(router *mux.Router) {
doctorroutes := router.PathPrefix("/mddoctor").Subrouter()
doctorroutes.Use(auth.WithAuthStore(h.authStore))
doctorroutes.Use(auth.AuthMiddleware)
doctorroutes.HandleFunc("/searchdoctor", h.handlerSearchDoctor).Methods(http.MethodPost)