diff --git a/app/http/endpoints/api/whitelabel.go b/app/http/endpoints/api/whitelabel.go index a099fdd..d195720 100644 --- a/app/http/endpoints/api/whitelabel.go +++ b/app/http/endpoints/api/whitelabel.go @@ -1,6 +1,7 @@ package api import ( + "github.com/TicketsBot/GoPanel/config" dbclient "github.com/TicketsBot/GoPanel/database" "github.com/TicketsBot/GoPanel/messagequeue" "github.com/TicketsBot/GoPanel/rpc" @@ -16,11 +17,21 @@ func WhitelabelHandler(ctx *gin.Context) { premiumTier := rpc.PremiumClient.GetTierByUser(userId, false) if premiumTier < premium.Whitelabel { - ctx.JSON(402, gin.H{ - "success": false, - "error": "You must have the whitelabel premium tier", - }) - return + var isForced bool + for _, forced := range config.Conf.ForceWhitelabel { + if forced == userId { + isForced = true + break + } + } + + if !isForced { + ctx.JSON(402, gin.H{ + "success": false, + "error": "You must have the whitelabel premium tier", + }) + return + } } // Get token diff --git a/app/http/endpoints/root/whitelabel.go b/app/http/endpoints/root/whitelabel.go index 2a08ba9..c0be63c 100644 --- a/app/http/endpoints/root/whitelabel.go +++ b/app/http/endpoints/root/whitelabel.go @@ -20,8 +20,18 @@ func WhitelabelHandler(ctx *gin.Context) { premiumTier := rpc.PremiumClient.GetTierByUser(userId, false) if premiumTier < premium.Whitelabel { - ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite)) - return + var isForced bool + for _, forced := range config.Conf.ForceWhitelabel { + if forced == userId { + isForced = true + break + } + } + + if !isForced { + ctx.Redirect(302, fmt.Sprintf("%s/premium", config.Conf.Server.MainSite)) + return + } } ctx.HTML(200, "main/whitelabel", gin.H{ diff --git a/config/config.go b/config/config.go index 073345e..98f0146 100644 --- a/config/config.go +++ b/config/config.go @@ -7,13 +7,14 @@ import ( type ( Config struct { - Admins []uint64 - Server Server - Oauth Oauth - Database Database - Bot Bot - Redis Redis - Cache Cache + Admins []uint64 + ForceWhitelabel []uint64 + Server Server + Oauth Oauth + Database Database + Bot Bot + Redis Redis + Cache Cache } Server struct {