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
Solve issue #14: Add user authentication functionality #29
Conversation
Hello @vitokhangnguyen! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-10-06 07:27:15 UTC |
@vitokhangnguyen Please pull the latest changes in your branch |
@vitokhangnguyen What are the new dependencies that you have added here? |
Hi @Haider8, |
Just did. Sorry that I didn't realize there were commits while I was updating the code. |
@Haider8 I just made the changes. Tell me if you want any other code changed. |
tmessage/cli.py
Outdated
@@ -1,6 +1,7 @@ | |||
import paho.mqtt.client as mqtt | |||
import argparse | |||
from colorama import init, deinit, Fore, Back, Style | |||
import auth # auth.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitokhangnguyen Here I am getting this error ModuleNotFoundError: No module named 'auth'
when I start the program using tmessage command i.e tmessage --user test
but it is working perfectly fine when I run using the command python tmessage/cli.py --user test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
I fixed the issue by changing import auth
to...
import tmessage.auth as auth
It is working now but I don't fully understand what is the difference and why it complains in 1 case but not the other, it would be nice if you can enlighten me :)
@vitokhangnguyen PR looks good to go. Just make the changes in README about the environment variable for using the auth API. |
I have deployed the API here, make this a default API Url in case the user hasn't set up his own auth API. |
Thank you for making the changes for me. It has been a good experience for me learning Python through this project. |
@vitokhangnguyen So happy to hear that :) 🥇 If you like this project, please give this repository a star to show us your support 🥇 |
Hi,
This PR is for issue #14.
I have added codes to interact with tmessage-api to do user verification.
Some notes of what I have added/changed:
localhost:8080
to verify user by default. To change this, create an environment variable file.env
and add theAPI_BASE_URL
variable:user_name
and adisplayed_name
which are both displayed when their messages appear. We can change this later. user_name is the name user provides for--user
parameter while displayed_name is the name user provides during registration.