Skip to content

Commit

Permalink
experimental: password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
adelevie committed May 4, 2012
1 parent e1b967d commit 1038b19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/parse/protocol.rb
Expand Up @@ -93,6 +93,7 @@ module Protocol
# The class name for User objects, when referenced by a Pointer.
CLASS_USER = "_User"
USER_LOGIN_URI = "/#{VERSION}/login"
PASSWORD_RESET_URI = "/#{VERSION}/requestPasswordReset"

KEY_USER_SESSION_TOKEN = "sessionToken"

Expand Down
5 changes: 5 additions & 0 deletions lib/parse/user.rb
Expand Up @@ -17,6 +17,11 @@ def self.authenticate(username, password)
new(response)
end

def self.reset_password(email)
body = {"email" => email}
Parse.client.post(Parse::Protocol::PASSWORD_RESET_URI, body)
end

def initialize(data = nil)
@class_name = Parse::Protocol::CLASS_USER

Expand Down

0 comments on commit 1038b19

Please sign in to comment.