This project aims to develop a Django application that provides a simple email and password authentication system to allow users to sign up and log in. Additionally, the application allows listing all registered users. The project will use Django REST Framework (DRF) to develop a RESTful API. SQLite will be used as the database.
The following features can be added to the application in the future:
We will add in another functionality (as an endpoint). The browser extension makes JWT_token, as such. This is written in Python, but this would happen in JavaScript extension logic defined in the gH for Spock.
Once we generate this, we will verify this via a function on the backend as such:
To verify a JWT token in an actual application, you can use the jwt.decode() method provided by the PyJWT library. Here's an example implementation:
This function takes a token as input and attempts to decode it using the jwt.decode() method. If decoding is successful, the function returns the payload (which should contain the user_id). If the token has expired or is invalid, the function raises an exception or returns an error message.
In our application, we would typically call the verify_jwt_token() function to verify a token before granting access to a protected resource or performing an action on behalf of the user. For example, we could use it as follows:
And with this, we can convert it to an SDK (in Python) by packaging this in a library format (here and in Rust or something).