Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Kacper Czochara
    @Slacki
    it's just simple as fuck
    and it works just good
    even moron like me can handle it
    Geofrey Ernest
    @gernest
    well iit aint a silver bullet.
    It takes time to master, and most of the times we dont even need it.
    Kacper Czochara
    @Slacki
    @gernest any example of how to get sessions to work?
    Geofrey Ernest
    @gernest
    @Slacki sorry I’m busy right now but I will get back to you later.
    Kacper Czochara
    @Slacki
    That's okay. When can I expect you?
    Geofrey Ernest
    @gernest
    @Slacki are you there?
    Kacper Czochara
    @Slacki
    yeah
    is it okay if i will be back in just 15 minutes?
    i have to do something
    @gernest
    Geofrey Ernest
    @gernest
    Okay
    Kacper Czochara
    @Slacki
    okay thank you be right back.
    Kacper Czochara
    @Slacki
    okay im here
    Kacper Czochara
    @Slacki
    if you could give me some more complex example of utron app which include user authentication and stuff...
    Geofrey Ernest
    @gernest
    well, my github is like a treasure island
    @Slacki
    There are lots of such projects there
    that is a good start
    session handling is there too
    @Slacki are you there?
    Kacper Czochara
    @Slacki
    yeah
    but is it written in utron?
    Geofrey Ernest
    @gernest
    nope
    but Golang
    Utron is a framework
    You can use all sorts of libraries and stuffs with it
    Kacper Czochara
    @Slacki
    can we consider i want to use gorilla/session package
    how would you compose it with utron
    so that for example check whether user is logged in or not is fired up on selected controller methods
    where should i initialize it's storage, as in documentation
    so that i can access it in controllers package
    Geofrey Ernest
    @gernest
    The gorilla session api is simple
    do it in an init function, either in the models or controllers
    there is endless possibiilities
    Kacper Czochara
    @Slacki
    and then i should check for user's session in each controller method?
    Geofrey Ernest
    @gernest
    You just need to know why you need to do it.
    and you can even stuck it into Context
    Kacper Czochara
    @Slacki
    okay one more thing
    Geofrey Ernest
    @gernest
    You can do the check in a middleware
    Kacper Czochara
    @Slacki
    there are several files in controllers package
    for example user.go, post.go, etc
    where should I put the init func
    Geofrey Ernest
    @gernest
    a good way is to have a middleware that checks for user's session
    Kacper Czochara
    @Slacki
    i was thinking about the middleware, but where should I place it? in main.go?
    Geofrey Ernest
    @gernest
    you can do that in many ways, easies is in controller package
    create a new file maybe and define the middleware there