Replies: 1 comment 2 replies
-
Hello bro, there is a common workflow for authentication, it is by using the middleware Auth, then you can access the user model and also IsAuthenticated which return bool from any handler https://github.com/kamalshkeir/kago/blob/master/core/kamux/context.go#L95 , https://github.com/kamalshkeir/kago/blob/master/core/kamux/context.go#L104, and from any html page like so https://github.com/kamalshkeir/kago-assets/blob/master/templates/admin/admin_nav.html#L17, this middleware store the session token cookie, which is an AES token , and finaly for the logout, you only need to delete cookie session, using for example https://github.com/kamalshkeir/kago-assets/blob/master/templates/admin/admin_nav.html#L17 |
Beta Was this translation helpful? Give feedback.
-
What is the best way to use an integrated authentication system in my app? I see parts of using it in different examples, but there is no special authentication workflow that is a kago way. I know, I can use User model, I can manually check passwords, I can build the whole chain of this, but I think I can miss some existing kago possibilities or overweight the solution. Is it possible to have a separate example of authentication process for a starting web-project to integrate it as fast as possible for a user? The common workflows like:
1.1) Account activation route if email confirmation was used
Repeat myself - I know I can pull out parts of this code from other examples (I saw it there) but... This is so common, usual and boring workflow that I (I'm sure not only me) would prefer just use it and not to spend time to investigate it every time or... Just use it, just bind to my web application and forget about it...
Beta Was this translation helpful? Give feedback.
All reactions