Skip to content

Instantly share code, notes, and snippets.

@rubyonrailstutor
Created August 6, 2013 16:24
Show Gist options
  • Save rubyonrailstutor/6166069 to your computer and use it in GitHub Desktop.
Save rubyonrailstutor/6166069 to your computer and use it in GitHub Desktop.
user auth
.factory("Session", () ->
Session =
user: "john"
show_user: () ->
console.log @new_auth.user
connection: new Firebase("https://pitchclub.firebaseIO.com/rooms")
new_auth: {}
login: () ->
firebase = new Firebase("https://pitchclub.firebaseIO.com/rooms")
return_user = {}
@new_auth = new FirebaseSimpleLogin(@connection, (error, user) ->
if error
console.log "error detected"
else if user
console.log user
else if ! user && ! error
console.log "logout successful"
)
@new_auth.login("facebook")
logout: () ->
@new_auth.logout()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment