Bug 631

Summary: Users can repeatedly register an existing account
Product: New-Territories-Cycle-Track-Navigation-System Reporter: dianpchen2-c
Component: RegisterAssignee: ruiruyang2-c
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: 1.0   
Hardware: PC   
OS: Windows   

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;

    }