auto logout
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user