feat: add cors_origins
This commit is contained in:
		
							parent
							
								
									daa90869cf
								
							
						
					
					
						commit
						3fec9d794d
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		
							
								
								
									
										7
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										7
									
								
								main.go
									
										
									
									
									
								
							|  | @ -50,7 +50,12 @@ func main() { | |||
| 		MaxAge:   60 * 80 * 24 * 7, // 7 days | ||||
| 		HttpOnly: true, | ||||
| 		Secure:   os.Getenv("ENV") == "production", | ||||
| 		SameSite: http.SameSiteLaxMode, | ||||
| 		SameSite: func() http.SameSite { | ||||
| 			if os.Getenv("CORS_ORIGINS") != "" { | ||||
| 				return http.SameSiteNoneMode | ||||
| 			} | ||||
| 			return http.SameSiteLaxMode | ||||
| 		}(), | ||||
| 	}) | ||||
| 	r.Use(sessions.Sessions("rideaware-session", store)) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cipher Vance
						Cipher Vance