Being my first ever live project, it came with its own learning and difficulties. I was fortunate enough to get a supportive mentor who encouraged and supported me throughout the project. As this was my first project, I wanted to concentrate on every aspect and detail to deliver my best. It was a huge project, with a prominent client which meant a huge responsibility was on my shoulder and I was a newbie. The Project was Peatio. Peatio, a core, open-source Crypto-currency, and digital asset exchange platform, is built and implemented on the Rails framework (Ruby on Rails) and other advanced technologies and server components.
During this project, I worked on multiple modules but the one I found fascinating and challenging was “To Login into User’s Account”. In this module, the admin can log in to the user’s account but in reading mode through the user's email address or id.
The current user session (Admin) needs to be stored after which the admin can log in to the user's account with a new session.
After logging out from the user account, it should return to the same page with the stored session (Admin).
The user account should always open in ‘Read-only mode.
To complete this module, I made use of the session variable.
Step 1: Saving the session of the admin role in one session variable.
Step 2: Fetching and saving the user id in another session variable.
Step 3: Finally replace the new user session variable with the current session variable by placing proper conditions to execute it in read-only mode.