934 questions
Best practices
1
vote
0
replies
29
views
Where should I create the application session when using an internal SSO (Gin + OAuth2)?
I’m integrating an internal SSO (OAuth2) into a web application using Gin (Go), and I’m a bit unsure about the right place to create the application session.
The SSO is the only authentication ...
0
votes
0
answers
63
views
Why am I observing an unexpected behavior using github.com/utrack/gin-csrf
I'm using the github.com/utrack/gin-csrf package to implement CSRF protection in my web application and using. I'm observing an unexpected pattern using the simple go application in their repo.
Step 1 ...
0
votes
1
answer
60
views
How to get second relation data from the model in gorm
i am new to go-lang and i have been using gin, gorm and postgres for backend api and i want to get the data from the model.
user model:
package models
import "gorm.io/gorm"
// enum role
...
4
votes
0
answers
141
views
Bind form data into nested slice with Gin-Gonic
I'm trying to send a post request with form data and bind it to a nested slice.
Here's a minimal example:
type House struct {
Rooms []Room `form:"rooms"`
}
type Room struct {
...
-3
votes
2
answers
102
views
PostgreSql Database Design [closed]
While designing social media application, i want my my users to have unique email and unique username, but the problem is, I am providing an otp verification and my table have coulmn id int primary ...
1
vote
1
answer
101
views
gin-contrib/sessions creating new session for every request
I'm trying to use gin-contrib/sessions but every time I make a request to the server a new session is created. It is never finding a previously created session and I can't access any data that should ...
0
votes
0
answers
64
views
multipart: NextPart: EOF Error in ServiceController.CreateService, but Test Route in main.go Works
Here's a detailed description for your GitHub issue, incorporating the information we've discussed. This provides context, the problem statement, steps to reproduce, and your observations.
package ...
0
votes
1
answer
115
views
What is the difference between ctx.AbortWithStatusJSON() and ctx.JSON() methods in golang GIN
What is the difference between the methods ctx.AbortWithStatusJSON() and ctx.JSON()? As I understand it, the first one calls TWO methods inside itself - Abort(), which interrupts the processing of the ...
1
vote
2
answers
117
views
Cookies is dissapear after reloading the page
I'm trying to set access-token and refresh-token in cookies, so i know that the cookies configuration has to set to be same_site=none and secure=true to do cross-site.
So i did that over the https by ...
1
vote
1
answer
132
views
Issues Debugging Go in Vscode
gopark
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?...
2
votes
1
answer
72
views
Go Gin is not reporting errors on HTML templates
I'm trying to figure out how to get Go Gin to log errors when there is a missingkey.
I have a
tmpl.Option("missingkey=error")
to each of my templates, and I render them as follows
c....
1
vote
2
answers
194
views
Using Go Gin with nested template files
What I'm trying to achieve is using r.LoadHTMLGlob("./web/templates/**/*") and loading pages "dynamically". Both Go and Gin are very new to me, so I'm not sure what I'm doing is ...
1
vote
0
answers
292
views
Using Clerk with Gin for Protected Routes to Retrieve Appointments
I'm building a SaaS application for professional masseurs using Gin in Go, and I want to integrate Clerk for authentication. I need to protect some routes (e.g., GET /api/appointments) so that only ...
0
votes
0
answers
46
views
Android Client With a Go Server Secure Connection
I'm developing an Android application (Jetpack Compose with Ktor) that communicates with a server I am building in Go (with Gin).
While I have checked that everything works locally between the ...
1
vote
0
answers
167
views
go-swagger generated swagger UI gets CORS error even if I already handled it
After some research and testing, I still can't figure out why the swagger UI generated by go-swagger is saying my API still has a CORS error even if I already handled it. I'm not sure if it's an ...