https://supertokens.com/ logo
Title
u

_Nico

11/12/2022, 1:35 AM
Hello! I have multiple questions. I'm developing backend written in Golang. 1) I'm trying to override every error response... is there any specific guide? I tried reading the documentation but I'm not sure what I'm looking for. I mean, I get to the point where I kinda know what I want to override but I'm not sure how I have to modify the function body 2) What's the difference between a session and validating, let's say, a JWT? 3) I'm using email+pw+social recipe, should I use session as well? 4) I have created a logging and respond middleware (it's pretty simple) but I write the status and body into gin context keys so I could fetch them easily after. I'f I have to override a session method there's no way I could receive a different context other than the one in the option request? I'm actually looking for something pretty simple -> sign up, login, check if the user is logged with a middleware and logout šŸ™‚ Thanks!
r

rp

11/12/2022, 4:37 AM
hey @_Nico
1) there is no specific guide for all the error responses we have, other than the API spec of the backend SDK APIs: https://app.swaggerhub.com/apis/supertokens/FDI
2) Our session comprises of a stateless access token (similar to a JWT) and a stateful refresh token.
3) Yes. Emailpassword + social will only give you the login feature, you need sessions as well
4) you can easily implement sign up, login, checking if a user is logged in etc.. without doing any modifications. I don't think this question is very clear to me - why do you want to override anything to achieve this?
u

_Nico

11/12/2022, 4:57 AM
Thanks @rp 4) Because I have a custom middleware right after the validation, the chain would look like this: log incoming request validateSession handler log response respond
r

rp

11/12/2022, 4:59 AM
> I'f I have to override a session method there's no way I could receive a different context other than the one in the option request? The context in the options param of the override is not the same as the gin context. But you also get the request object itself, which contains the gin context?
u

_Nico

11/12/2022, 5:26 AM
> The context in the options param of the override is not the same as the gin context. But you also get the request object itself, which contains the gin context? Are you sure? I can't seem to get the pointer of the gin context inside the override šŸ˜¦
r

rp

11/12/2022, 5:27 AM
You have access to the http request object there. Does that not contain the gin context?
u

_Nico

11/12/2022, 6:01 PM
No that I know of... Gin context contains http request object
r

rp

11/12/2022, 6:03 PM
Hmm I see. Can you please open an issue about this on our GitHub? Iā€™m sure we can come up with a nice solution to this
u

_Nico

11/12/2022, 6:05 PM
Sure! No problem šŸ˜„