Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: log in by using a session token #19

Merged
merged 2 commits into from Feb 16, 2022

Conversation

ttycelery
Copy link
Owner

I have recently faced a problem where I have to share my username and password when trying to "ensure" my presence.

This PR has mainly changed the logging in logic. This PR contains changes that made it possible to log in with a session token instead of a username and a password. This way, if in some scenario, a user won't have to share their credentials.

A "session token" is actually just a string comprised of a logged in SimasterQRPresence instance's session_id and group_id. Some new methods (a way to serialize and deserialize a session token) have also been added to simaster.py file.

From the front perspective, the home.html has also been changed. After logging in, there will be a small text displayed on the alert box that contains the last session token.

These two methods have been added to make it
possible to log in with a session id and a group
id instead of username and password.

Signed-off-by: Faiz Jazadi <me@lcat.dev>
This commit have utilized two new methods from
the previous commit: `load_session` and
`serialize_session`. From this commit, a token
will be given everytime a user has successfully
logged in (given in the alert window).
That token can then be used to login by entering
the token into the username field.

Signed-off-by: Faiz Jazadi <me@lcat.dev>
@ttycelery ttycelery merged commit 7a5ac36 into main Feb 16, 2022
ttycelery added a commit that referenced this pull request Nov 2, 2023
New feature: log in by using a session token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant