feat: add super admin auth
This commit is contained in:
@@ -35,5 +35,5 @@ func (c *auth) Login(ctx fiber.Ctx, form *dto.LoginForm) (*dto.LoginResponse, er
|
||||
// @Produce json
|
||||
// @Success 200 {object} dto.LoginResponse
|
||||
func (c *auth) CheckToken(ctx fiber.Ctx) (*dto.LoginResponse, error) {
|
||||
return services.Super.CheckToken(ctx)
|
||||
return services.Super.CheckToken(ctx, ctx.Get("Authorization"))
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package dto
|
||||
import "quyun/v2/pkg/consts"
|
||||
|
||||
type LoginForm struct {
|
||||
Phone string `json:"phone"`
|
||||
OTP string `json:"otp"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
type LoginResponse struct {
|
||||
|
||||
@@ -6,6 +6,6 @@ func (r *Routes) Path() string {
|
||||
|
||||
func (r *Routes) Middlewares() []any {
|
||||
return []any{
|
||||
r.middlewares.Auth,
|
||||
r.middlewares.SuperAuth,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user