import (
"github.com/gin-gonic/gin"
"github.com/stupidwebauthn/swa_sdk_go"
)
r.Use(func(c *gin.Context) {
header := c.Writer.Header()
res, status, err := swa.AuthMiddleware(c.Request, &header)
if err != nil {
c.AbortWithError(status, err)
return
}
c.Set("swa", res)
c.Next()
})
r.GET("/api/data", func(c *gin.Context) {
rawAuth, _ := c.Get("swa")
auth := rawAuth.(*swa_sdk_go.AuthResponse)
...
})
-
Notifications
You must be signed in to change notification settings - Fork 0
GoLang sdk
License
stupidwebauthn/swa_sdk_go
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
GoLang sdk