Bug 631 - Users can repeatedly register an existing account
Summary: Users can repeatedly register an existing account
Status: RESOLVED FIXED
Alias: None
Product: New-Territories-Cycle-Track-Navigation-System
Classification: Unclassified
Component: Register (show other bugs)
Version: 1.0
Hardware: PC Windows
: Normal normal
Assignee: ruiruyang2-c
URL:
Depends on:
Blocks:
 
Reported: 2021-12-01 00:11 HKT by dianpchen2-c
Modified: 2021-12-01 10:08 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dianpchen2-c 2021-12-01 00:11:56 HKT
Steps to reproduce:
1. User input '0'
2. Registered an existing account 


Actual result:
Successfully registered an existing account

Expected result:
register fail and pop up warning message"This account already exists. Registration failed."

Solution:

Check whether the account exists in both Class Register and Class Login.

Code:
public static boolean checkMemberExist(String email) throws FileNotFoundException {

        JSONObject memberInfo = getMemberInfo(email);
        if (memberInfo == null)
            return false;
        else
            return true;

    }