We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
I've not used Gin, but it should be pluggable as a normal HTTP middleware
Sorry, something went wrong.
You can do it like this @jkgeekJack
const casURL = "" func Auth() gin.HandlerFunc { url, _ := url.Parse(casURL) client := cas.NewClient(&cas.Options{URL: url}) handler := client.HandleFunc(func(writer http.ResponseWriter, request *http.Request) { // DO NOTHING }) return func(ctx *gin.Context) { // Call the normal method handler.ServeHTTP(ctx.Writer, ctx.Request) if !cas.IsAuthenticated(ctx.Request) { // redirect to login url ctx.Abort() } ctx.Next() } }
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: