2017-03-09 98 views
0

我想在流星賬戶登錄頁面隱藏此註冊按鈕。禁用流星註冊鏈接

enter image description here

我通過在AccountsTemplate

AccountsTemplates.configure({ 
    forbidClientAccountCreation: true, 
    ... 
}); 

問題設置屬性是找到一種方法,但它似乎我只能設置這個初始化模板時。

所以我有一個流星配置JSON文件的布爾我想讀:

settings.json

config { 
    'forbidUserReg' : true 
} 

,並會使用這個值是這樣的:

AccountsTemplates.configure({ 
    forbidClientAccountCreation: getUserRegConf(), 
    ... 
}); 

或者如果可能的話,另一種解決方案是隱藏登錄頁面上的註冊按鈕。

+0

你是否試圖阻止用戶註冊(如此刪除整個表單)或者只是隱藏藍色的註冊按鈕? – mutdmour

+0

你好,atm我只想隱藏這個章節。按鈕,但不能隱藏完整的登錄表單。用戶仍應能夠登錄,但無法創建新帳戶。 – Gobliins

回答

0

,如果你是通過調用

meteor --settings settings.json 

運行流星和你settings.json文件有這個

{ 
    "private": { 
     "forbidUserReg" : true 
    } 
} 

那麼你可以參考你的settings.json文件

AccountsTemplates.configure({ 
    forbidClientAccountCreation: Meteor.settings.private.forbidUserReg, 
    ... 
}); 

並隨時切換它