Fakultas Ilmu Komputer UI

06-1606887352 (Fix broken signup/login for students)

Closed IVANA IRENE THOMAS requested to merge pmpl/class-project/kape:1606887352-06 into master

Issue - pmpl/class-project/kape#6 (closed)

The current backend process of login for student is:

  • Create user
  • If role == 'mahasiswa', fetch student detail and create Student object

This process is broken because fetching student's detail from https://api.cs.ui.ac.id/siakngcs/mahasiswa/{npm}/(https://api.cs.ui.ac.id/siakngcs/mahasiswa/%7Bnpm%7D/) requires authentication which is not currently provided, the front end will always show that username/password is wrong even though it is correct because of the 403 error.

This fix will instead create student's object based on simple information from https://api.cs.ui.ac.id/authentication/ldap/v2/ response and let student's edit information such as birth place, birth date, major, and batch after they are successfully logged in.

What's done in MR:

  • Create test to test whether student object is created (without mocking succesful response to [https://api.cs.ui.ac.id/siakngcs/mahasiswa/{npm}/]
  • Create student object without student detail information
  • Modify student serializers and update method to add additional fields
  • Add additional fields in edit profile to accommodate reduced information from signup

(Added fields on edit profile page) image


Merge request reports