Tag: 篝火篝火

使用Firebase simplelogin强制使用唯一的用户名

我最近在Thinkster上使用Angular和Firebase创build了一个Web应用程序。 本教程使用Firebase simpleLogin方法允许创build包含用户名的“configuration文件”。 厂: app.factory('Auth', function($firebaseSimpleLogin, $firebase, FIREBASE_URL, $rootScope) { var ref = new Firebase(FIREBASE_URL); var auth = $firebaseSimpleLogin(ref); var Auth = { register: function(user) { return auth.$createUser(user.email, user.password); }, createProfile: function(user) { var profile = { username: user.username, md5_hash: user.md5_hash }; var profileRef = $firebase(ref.child('profile')); return profileRef.$set(user.uid, profile); }, login: function(user) { return auth.$login('password', […]