hide some information for visible but unreleased releases
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
10f19d46db
commit
7914fba52a
6 changed files with 56 additions and 55 deletions
|
@ -18,6 +18,14 @@ type (
|
|||
const TOKEN_LENGTH = 64
|
||||
const TOKEN_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
||||
|
||||
var ADMIN_BYPASS = func() bool {
|
||||
if os.Getenv("ARIMELODY_ADMIN_BYPASS") == "true" {
|
||||
fmt.Println("WARNING: Admin login is currently BYPASSED by ARIMELODY_ADMIN_BYPASS.")
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}()
|
||||
|
||||
var ADMIN_ID_DISCORD = func() string {
|
||||
envvar := os.Getenv("DISCORD_ADMIN_ID")
|
||||
if envvar == "" {
|
||||
|
|
|
@ -85,9 +85,9 @@ func MustAuthorise(next http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
func GetSession(r *http.Request) *Session {
|
||||
if os.Getenv("ARIMELODY_ADMIN_BYPASS") == "true" {
|
||||
return &Session{}
|
||||
}
|
||||
// if ADMIN_BYPASS {
|
||||
// return &Session{}
|
||||
// }
|
||||
|
||||
var token = ""
|
||||
// is the session token in context?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue