support global server push setting

This commit is contained in:
Roland Osborne 2022-11-09 14:38:45 -08:00
parent b40008517b
commit 8f4c15d5da
3 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,7 @@ func AddAccountApp(w http.ResponseWriter, r *http.Request) {
login := LoginAccess{ login := LoginAccess{
GUID: account.GUID, GUID: account.GUID,
AppToken: account.GUID + "." + access, AppToken: account.GUID + "." + access,
PushSupported: getBoolConfigValue(CNFPushSupported, true),
} }
// save app and delete token // save app and delete token

View File

@ -6,6 +6,9 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
) )
//CNFPushSupported for allowing push notifications
const CNFPushSupported = "push_notifications"
//CNFOpenAccess for allowing for public account creation //CNFOpenAccess for allowing for public account creation
const CNFOpenAccess = "open_access" const CNFOpenAccess = "open_access"

View File

@ -330,6 +330,8 @@ type LoginAccess struct {
AppToken string `json:"appToken"` AppToken string `json:"appToken"`
Created int64 `json:"created"` Created int64 `json:"created"`
PushSupported bool `json:"pushSupported"`
} }
//NodeConfig node configuration values //NodeConfig node configuration values