Merge c5da11792ccf350144f284445b0b19d77facc5ed into eb5f8920038ecf0b81bb61e9e61bac70b72cf4af
This commit is contained in:
commit
4648da6409
@ -20,26 +20,16 @@ func VerifyWhitelabel(isApi bool) func(ctx *gin.Context) {
|
||||
}
|
||||
|
||||
if tier < premium.Whitelabel {
|
||||
var isForced bool
|
||||
for _, id := range config.Conf.ForceWhitelabel {
|
||||
if id == userId {
|
||||
isForced = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isForced {
|
||||
if isApi {
|
||||
ctx.AbortWithStatusJSON(402, gin.H{
|
||||
"success": false,
|
||||
"error": "You must have the whitelabel premium tier",
|
||||
})
|
||||
} else {
|
||||
ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite))
|
||||
ctx.Abort()
|
||||
}
|
||||
return
|
||||
if isApi {
|
||||
ctx.AbortWithStatusJSON(402, gin.H{
|
||||
"success": false,
|
||||
"error": "You must have the whitelabel premium tier",
|
||||
})
|
||||
} else {
|
||||
ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite))
|
||||
ctx.Abort()
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import (
|
||||
|
||||
type Config struct {
|
||||
Admins []uint64 `env:"ADMINS"`
|
||||
ForceWhitelabel []uint64 `env:"FORCED_WHITELABEL"`
|
||||
Debug bool `env:"DEBUG"`
|
||||
SentryDsn *string `env:"SENTRY_DSN"`
|
||||
JsonLogs bool `env:"JSON_LOGS" envDefault:"false"`
|
||||
|
@ -9,9 +9,8 @@
|
||||
---
|
||||
|
||||
- ADMINS
|
||||
- FORCED_WHITELABEL
|
||||
- SENTRY_DSN
|
||||
- SERVER_ADDR
|
||||
- SENTRY_DSN
|
||||
- SERVER_ADD
|
||||
- METRIC_SERVER_ADDR
|
||||
- BASE_URL
|
||||
- MAIN_SITE
|
||||
|
Loading…
x
Reference in New Issue
Block a user