I don't see where is validation part here, in article you've linked. I guess there should be around ready to use gin middlewares which make use JWT for access control. However, issuing token in article is more or less correct and there won't be much of improvement on this. Also, speaking of article you linked, I don't see point using Redis here. It kind of defies benefits of use of stateless JWT tokens.