Skip to content

Commit 559dc25

Browse files
committed
Released Version 2.8.1
* Fixed issue of function authenticate user * Add API for authenticate user by emailid
1 parent 933114d commit 559dc25

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

lib/LoginRadius.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
__copyright__ = "Copyright 2016-2017, LoginRadius"
3030
__email__ = "developers@loginradius.com"
3131
__status__ = "Production"
32-
__version__ = "2.8"
32+
__version__ = "2.8.1"
3333

3434
SECURE_API_URL = "https://api.loginradius.com/"
3535
HEADERS = {'Accept': "application/json"}

lib/UserRegistration.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
__copyright__ = "Copyright 2015-2016, LoginRadius"
2828
__email__ = "developers@loginradius.com"
2929
__status__ = "Production"
30-
__version__ = "2.8"
30+
__version__ = "2.8.1"
3131

3232
SECURE_API_URL = "https://api.loginradius.com/"
3333
HEADERS = {'Accept': "application/json"}
@@ -128,7 +128,7 @@ def _get_user_tuple(self):
128128
"""All the functions relative to the user with the token."""
129129
user = namedtuple("User", ['register_user', 'create_user', 'change_password', 'edit_user',
130130
'get_user_by_id', 'get_user_by_email', 'get_account', 'delete_account', 'set_username', 'generate_forgot_password_token', 'check_email',
131-
'link_account', 'unlink_account', 'create_raas_profile', 'authenticate_user', 'delete_user_with_email_confirmation', 'resend_verification_email'
131+
'link_account', 'unlink_account', 'create_raas_profile', 'authenticate_user', 'authenticate_user_by_email', 'delete_user_with_email_confirmation', 'resend_verification_email'
132132
'delete_account_with_email_confirmation', 'get_account_password', 'get_custom_object_by_accountid', 'get_custom_object_by_accountids',
133133
'check_custom_object', 'get_custom_object_by_objectid', 'get_custom_object_stats', 'get_custom_object_by_query', 'check_token_validate', 'check_token_invalidate',
134134
'add_or_remove_user_email', 'set_password', 'set_status', 'upsert_custom_object',
@@ -140,6 +140,7 @@ def _get_user_tuple(self):
140140
user.get_account = self.api.get_account
141141
user.delete_account = self.api.delete_account
142142
user.authenticate_user = self.api.authenticate_user
143+
user.authenticate_user_by_email = self.api.authenticate_user_by_email
143144
user.delete_user_with_email_confirmation = self.api.delete_user_with_email_confirmation
144145
user.generate_forgot_password_token = self.api.generate_forgot_password_token
145146
user.check_email = self.api.check_email
@@ -320,7 +321,14 @@ def delete_account(self, accountid):
320321
url = SECURE_API_URL + "raas/v1/account/delete"
321322
return self._lr_object._get_json(url, payload)
322323

323-
def authenticate_user(self, emailid, password):
324+
def authenticate_user(self, username, password):
325+
"""This API is used to authenticate users and returns the profile data associated with the authenticated user."""
326+
payload = {'appkey': self._lr_object._get_api_key(), 'appsecret': self._lr_object._get_api_secret(),
327+
'username': username, 'password': password}
328+
url = SECURE_API_URL + "raas/v1/user"
329+
return self._lr_object._get_json(url, payload)
330+
331+
def authenticate_user_by_email(self, emailid, password):
324332
"""This API is used to authenticate users and returns the profile data associated with the authenticated user."""
325333
payload = {'appkey': self._lr_object._get_api_key(), 'appsecret': self._lr_object._get_api_secret(),
326334
'emailid': emailid, 'password': password}

lib/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
setup(
33
name = 'LoginRadius',
44
py_modules = ['LoginRadius'],
5-
version = '2.8',
5+
version = '2.8.1',
66
description = 'Social Login and User Registration for Python.',
77
author='LoginRadius',
88
author_email='developers@loginradius.com',

0 commit comments

Comments
 (0)