Bug 565

Summary: User who has already registered cannot login when the program re-executed
Product: New-Territories-Cycle-Track-Navigation-System Reporter: lst <sitongliu9-c>
Component: JsonOperationAssignee: lst <sitongliu9-c>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: High    
Version: 1.0   
Hardware: PC   
OS: Windows   
Attachments: Registration.png
Login.png

Description lst 2021-11-16 10:07:14 HKT

    
Comment 1 lst 2021-11-16 10:52:23 HKT
Created attachment 81 [details]
Registration.png

This picture shows us the process of registration of a new account.
Comment 2 lst 2021-11-16 10:53:42 HKT
Created attachment 82 [details]
Login.png

This picture shows us the error that a registered account cannot be found in the database and cannot login.
Comment 3 lst 2021-11-16 10:59:06 HKT
Steps to reproduce;

Step 1: Register a new account in the system. (See Fig. Registration.png)
Step 2: Log in with that account. (See Fig. Login.png)

Actual result: Login unsuccessfully. The account does not exist. 
Expected result: Login successfully. Show me the MemberControlPanel.
Comment 4 lst 2021-11-16 11:05:23 HKT
Reason:
We use a Database class to store the information of registered members. When the program ends, the Database will be cleared. Therefore, this design does not support users' needs.

Solution:
We upgraded our design. Instead of using Database class, we maintain two JSON files (MemberInfo.json & AdminInfo.json). These two files will always hold the information, then the data will not lose.