Skip to content

Commit 318f91f

Browse files
committed
allowedorigin
1 parent 602ab5a commit 318f91f

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

apps/api/main.go

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,11 @@ func main() {
132132
mux.HandleFunc("/apikey-teams/list", authMW(aktmHandler.List))
133133
mux.HandleFunc("/apikey-teams/delete", authMW(aktmHandler.Detach))
134134

135-
136-
// Configure CORS via env FRONTEND_ORIGINS (comma-separated)
137-
originsEnv := os.Getenv("FRONTEND_ORIGINS")
138-
var allowedOrigins []string
139-
if originsEnv != "" {
140-
for _, o := range strings.Split(originsEnv, ",") {
141-
o = strings.TrimSpace(o)
142-
if o != "" { allowedOrigins = append(allowedOrigins, o) }
143-
}
144-
} else {
145-
allowedOrigins = []string{"*"}
146-
}
147-
148135
c := cors.New(cors.Options{
149-
AllowedOrigins: allowedOrigins,
136+
AllowedOrigins: []string{"https://one-password-web.vercel.app"},
150137
AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
151-
AllowedHeaders: []string{"Authorization", "Content-Type"},
152-
AllowCredentials: true,
138+
AllowedHeaders: []string{"Authorization", "Content-Type", "Accept", "Origin", "X-Requested-With"},
139+
AllowCredentials: allowCreds,
153140
})
154141

155142

0 commit comments

Comments
 (0)