Skip to content

Commit 3ac0b44

Browse files
committed
fix: remove unused env and fix typo
1 parent b1dd6f2 commit 3ac0b44

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

server/constants/constants.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var (
1313
JWT_TYPE = ""
1414
JWT_SECRET = ""
1515
ALLOWED_ORIGINS = []string{}
16-
ALLOWED_CALLBACK_URLS = []string{}
1716
AUTHORIZER_URL = ""
1817
PORT = "8080"
1918
REDIS_URL = ""

server/env.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Version string
1616
// ParseArgs -> to parse the cli flag and get db url. This is useful with heroku button
1717
func ParseArgs() {
1818
dbURL := flag.String("database_url", "", "Database connection string")
19-
dbType := flag.String("databse_type", "", "Database type, possible values are postgres,mysql,sqlite")
19+
dbType := flag.String("database_type", "", "Database type, possible values are postgres,mysql,sqlite")
2020
authorizerURL := flag.String("authorizer_url", "", "URL for authorizer instance, eg: https://xyz.herokuapp.com")
2121

2222
flag.Parse()
@@ -104,19 +104,6 @@ func InitEnv() {
104104
}
105105
constants.ALLOWED_ORIGINS = allowedOrigins
106106

107-
allowedCallbackSplit := strings.Split(os.Getenv("ALLOWED_CALLBACK_URLS"), ",")
108-
allowedCallbacks := []string{}
109-
for _, val := range allowedCallbackSplit {
110-
trimVal := strings.TrimSpace(val)
111-
if trimVal != "" {
112-
allowedCallbacks = append(allowedCallbacks, trimVal)
113-
}
114-
}
115-
if len(allowedCallbackSplit) == 0 {
116-
allowedCallbackSplit = []string{"*"}
117-
}
118-
constants.ALLOWED_CALLBACK_URLS = allowedCallbackSplit
119-
120107
ParseArgs()
121108
if constants.DATABASE_URL == "" {
122109
panic("Database url is required")

0 commit comments

Comments
 (0)