changed role permission
This commit is contained in:
1 parent
f0ecf23879
commit
323e131216
74 files changed
+2915
-4713
No files matched your search
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"online-back/internal/appresult"
|
||||
"online-back/internal/handlers"
|
||||
"online-back/internal/identity/rbac"
|
||||
"online-back/pkg/logging"
|
||||
"online-back/pkg/sms"
|
||||
|
||||
@@ -35,16 +36,16 @@ func NewHandler(logger *logging.Logger, repository Repository, sender sms.Sender
|
||||
}
|
||||
|
||||
func (h *handler) Register(router *gin.RouterGroup) {
|
||||
router.POST(loginURL, h.login)
|
||||
router.POST(tokenURL, h.refreshToken)
|
||||
router.POST(registerURL, h.register)
|
||||
router.POST(verifyURL, h.verify)
|
||||
router.POST(forgotPasswordURL, h.forgotPassword)
|
||||
router.POST(resetPasswordURL, h.resetPassword)
|
||||
rbac.Group(router, loginURL, rbac.Public()).POST("", h.login)
|
||||
rbac.Group(router, tokenURL, rbac.Public()).POST("", h.refreshToken)
|
||||
rbac.Group(router, registerURL, rbac.Public()).POST("", h.register)
|
||||
rbac.Group(router, verifyURL, rbac.Public()).POST("", h.verify)
|
||||
rbac.Group(router, forgotPasswordURL, rbac.Public()).POST("", h.forgotPassword)
|
||||
rbac.Group(router, resetPasswordURL, rbac.Public()).POST("", h.resetPassword)
|
||||
|
||||
protected := router.Group("", appresult.JwtTokenCheck())
|
||||
protected.GET(profileURL, h.getProfile)
|
||||
protected.PUT(profileURL, h.updateProfile)
|
||||
profile := rbac.Group(router, profileURL, rbac.Authenticated())
|
||||
profile.GET("", h.getProfile)
|
||||
profile.PUT("", h.updateProfile)
|
||||
}
|
||||
|
||||
// login godoc
|
||||
|
||||
Reference in new issue
Block a user