簡體   English   中英

如何確定用戶在Meteor中使用的登錄類型?

[英]How to Determine Type of Login that User Used in Meteor?

我正在尋找確定用戶登錄系統的服務類型的最佳方法。 我的意思是像Meteor.user()。typeOfLogin()這樣會返回例如('facebook','google','password')......或者至少可能有人知道如何手動檢查它的可靠方法。

我查看了官方文檔,但我找不到任何有用的內容: http//guide.meteor.com/accounts.html

您需要在項目中添加underscore

Meteor.users.helpers({
    typeOfLogin: function() {
            if (_.has(this.services, 'facebook'))
                return 'facebook';
            if (_.has(this.services, 'google'))
                 return 'google';
        }
});

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM