top of page
  • Writer's pictureAw Joey

Week 13

I intend to finish the OTP for registration feature, where the user must first key in the correct OTP before being able to register as a user. Upon invalid input of OTP, an error message is displayed using TempData. On the other hand, if the OTP is correct, the user will be registered and redirected the user home page. To do so, the new user's details must be passed to the RegisterOTP view so that the registration can be done after validating the OTP. However, I met into an impediment where I am not able to pass the User object using TempData or ViewData. As such, I did some research on how to store a User object into an temporary field. I found that I am able to do so by customizing an extension class, which I named TempDataExtensions, to store an object value into the TempData.

This is how the TempDataExtensions class is implemented:




My Learning Points:

I have learnt that objects can only be passed to another view with implemented extensions, such as the TempData extension I have used for this project.


What I would have done differently:

To make it easier to retrieve the User object details, I should have done a modal (pop-up window) for request of the OTP. I would also like to customize the OTP message a bit more, where it may state the User's username upon sending the message (for User Friendliness). Furthermore, I would also have wished to integrate this into the Edit Account page, where users are able to change their phone number.


Personal Thoughts:

I have learnt more about how to send OTP messages, where we used Twilio to send them. I have also broaden my understanding of TempData, which would be beneficial for me when I am creating WEB applications in the future. Overall, this was a fruitful week!


9 views

Recent Posts

See All

Comentarios


bottom of page