Skip to content

Echo custom authentication middleware not short circuting route. #1810

Answered by geekbozu
geekbozu asked this question in Q&A
Discussion options

You must be logged in to vote

Well I'll answer my own question...
This was copied out of the middle ware example on the docs page. The comments/code looks like its just an error handler for something but its actually processing the middleware chain and looking for an error before processing the code below it.
This makes sense for the statistics logger example given.
However its really bad for boiler plate middleware code....oh well I hope someone on the google fu finds this and can learn from my mistake

			if err := next(c); err != nil {
				c.Error(err)
			}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jdelamar
Comment options

@aldas
Comment options

@geekbozu
Comment options

Answer selected by geekbozu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants