mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-15 13:02:14 +08:00
Merge 19f77bdd4ce66f2c79dd56cec3baf8de206f1115 into 3d002e382355cafc15d706b92899b1961d5b79e9
This commit is contained in:
commit
dbb4defc47
@ -583,7 +583,7 @@ func main() {
|
||||
// /admin/secrets endpoint
|
||||
// hit "localhost:8080/admin/secrets
|
||||
authorized.GET("/secrets", func(c *gin.Context) {
|
||||
// get user, it was setted by the BasicAuth middleware
|
||||
// get user, it was set by the BasicAuth middleware
|
||||
user := c.MustGet(gin.AuthUserKey).(string)
|
||||
if secret, ok := secrets[user]; ok {
|
||||
c.JSON(http.StatusOK, gin.H{"user": user, "secret": secret})
|
||||
|
Loading…
x
Reference in New Issue
Block a user