I have a simple app written in Go using SuperTokens, but for some reason frontend requests get a 403...
d
I have a simple app written in Go using SuperTokens, but for some reason frontend requests get a 403 Forbidden on OPTIONS requests which seems to trigger CORS issues:```go func main() { apiBasePath := "/auth" websiteBasePath := "/auth" err := supertokens.Init(supertokens.TypeInput{ Supertokens: &supertokens.ConnectionInfo{ ConnectionURI: "http://localhost:3567", APIKey: "hrR6QzAuKmGbqcDSt5MKdaFb8Y88iboj", }, AppInfo: supertokens.AppInfo{ AppName: "Sitling", APIDomain: "http://localhost:5001", WebsiteDomain: "http://127.0.0.1:5173", APIBasePath: &apiBasePath, WebsiteBasePath: &websiteBasePath, }, RecipeList: []supertokens.Recipe{ thirdpartyemailpassword.Init(&tpepmodels.TypeInput{}), session.Init(nil), userroles.Init(nil), dashboard.Init(nil), }, }) if err != nil { panic(err.Error()) } r := chi.NewRouter() // CORS r.Use(cors.Handler(cors.Options{ AllowedOrigins: []string{"http://127.0.0.1:5173", "http://localhost:5173"}, AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, AllowedHeaders: append([]string{"Content-Type"}, supertokens.GetAllCORSHeaders()...), AllowCredentials: true, })) // SuperTokens Middleware r.Use(supertokens.Middleware) err = http.ListenAndServe(":5001", r) if err != nil { panic(err.Error()) } } ```
r
hey @dan6erbond
have you tried running our demo app? https://github.com/supertokens/supertokens-golang/blob/master/examples/with-chi/main.go Does this face the same issue?
d
Turns out having at least one route that uses
session.VerifySession
makes it work. I'm not sure why that is but now I can access the dashboard.
r
Huh. That’s odd.
If you can open an issue about it, we can investigate