dmotts / yt-to-cloud-uploader

This application allows users to download YouTube videos or playlists and upload them directly to their Google Drive. #hacktoberfest
MIT License
8 stars 12 forks source link

[Feature Request] Add login on page #28

Open HomerusJa opened 6 days ago

HomerusJa commented 6 days ago

Is there an existing issue for this?

Feature Description

To make the app more usable, we should add the feature to log in directly on the server without modifying a file on the serverside.

Use Case

It would enhance the usability.

Benefits

No response

Add Screenshots

No response

Priority

Medium

Record

github-actions[bot] commented 6 days ago

Thank you for creating this issue! 🎉 We'll look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊

You can also check our CONTRIBUTING.md for guidelines on contributing to this project.

HomerusJa commented 6 days ago

This is different to #17 because it right here, you should be able to input your keys and stuff. I think, this should be done before proceeding with #17.

dmotts commented 6 days ago

Agreed @HomerusJa. Have at it!

HomerusJa commented 6 days ago

Should we directly go with a solution which would allow multiple passwords and so on and which stores them in a SQLite database? This would be significantly more work, but we wouldn't just redo this issue again when we start working on #17.

dmotts commented 6 days ago

Multiple passwords for a single user. @HomerusJa please elaborate if you will.

dmotts commented 6 days ago

@HomerusJa at this stage, I believe we should keep things fairly simple not to create unnecessary complexity. However, since you restructured the application. I'll let you decide what you think is best. Remember, this is suppose to be fun, we're in it for the love of code! Have fun with it! 😃

shaikmynuddin commented 5 days ago

Hi @dmotts can I help looking forward for your reply

dmotts commented 5 days ago

Hey @shaikmynuddin, this task has been assigned to @HomerusJa so I'll let him decide if he'll want a hand. In the meantime, feel free to explore the other issues or open source projects available.

HomerusJa commented 5 days ago

@shaikmynuddin You can happily work on this. I’ll be gone for the next few days, so there you go!

HomerusJa commented 5 days ago

You might want to have a look at this: https://github.com/mkhorasani/Streamlit-Authenticator , but I think this can also easily be implemented by yourself.

dmotts commented 5 days ago

@HomerusJa @shaikmynuddin @swarupn17 @shawaiz-khan Guys please note, that we are moving away from streamlit to a more suitable option. I implore you to express your thoughts and ideas here -> #31

dmotts commented 5 days ago

Thank you for your co-operation guys! 💪💯🙌

dmotts commented 5 days ago

If I didn't mention your name, it just means it didn't show up on my dropdown menu. Just know, when I say 'guys' or 'people' or 'team'. I'm talking to everyone! 😄

dmotts commented 5 days ago

Let's go! 💥💯,💥

shaikmynuddin commented 4 days ago

@HomerusJa @shaikmynuddin @swarupn17 @shawaiz-khan Guys please note, that we are moving away from streamlit to a more suitable option. I implore you to express your thoughts and ideas here -> #31

Yes I am looking into that also first I will complete these as some Example login page

dmotts commented 4 days ago

Great @shaikmynuddin! I'm looking forward to seeing it. 😁

dmotts commented 15 hours ago

Hey @shaikmynuddin. This may require the frontend to be completed however, creating the API would be good to go since the project has a new structure.

shaikmynuddin commented 9 hours ago

Owner

I have worked on authentication I used flask and react for that simple sign up and login first we have change the streamlit content to web then I can integrate it features

shaikmynuddin commented 9 hours ago

Screenshot 2024-10-20 090338 code app = Flask(name) CORS(app, supports_credentials=True) app.config.from_object(ApplicationConfig) db.init_app(app) bcrypt = Bcrypt(app) Session(app) with app.app_context(): db.create_all()

@app.route("/@me") def get_current_user(): user_id = session.get("user_id")

if not user_id:
    return jsonify({"error": "Unauthorized"}), 401

user = User.query.filter_by(id=user_id).first()
return jsonify({
    "id": user.id,
    "email": user.email
}) 

@app.route("/register", methods=["POST"]) def register_user(): data = request.get_json() email = data["email"] password = data["password"]

user_exists = User.query.filter_by(email=email).first()

if user_exists:
    return jsonify({"error": "User already exists"}), 409

hashed_password = bcrypt.generate_password_hash(password).decode('utf-8')
new_user = User(email=email, password=hashed_password)
db.session.add(new_user)
db.session.commit()

session["user_id"] = new_user.id

return jsonify({
    "id": new_user.id,
    "email": new_user.email
})

@app.route("/login", methods=["POST"]) def login_user(): data = request.get_json() email = data["email"] password = data["password"]

user = User.query.filter_by(email=email).first()

if user is None:
    return jsonify({"error": "Login details are incorrect"}), 401

if not bcrypt.check_password_hash(user.password, password):
    return jsonify({"error": "Unauthorized"}), 401

session["user_id"] = user.id

return jsonify({
    "id": user.id,
    "email": user.email
})

@app.route("/logout", methods=["POST"]) def logout_user(): session.pop("user_id", None) return jsonify({"message": "Successfully logged out"})

shaikmynuddin commented 9 hours ago

I want Mainly tech stacks of Application So it would be easy to integrate and I didn't received any request yet in the discord can paste link of your channel

HomerusJa commented 7 hours ago

We are going for a FastAPI and SQLAlchemy tech stack in the backend. If you have any questions regarding the targeted architecture/the libraries used, feel free to ask. Can you prepend the routes with /auth?

shaikmynuddin commented 7 hours ago

We are going for a FastAPI and SQLAlchemy tech stack in the backend. If you have any questions regarding the targeted architecture/the libraries used, feel free to ask. Can you prepend the routes with /auth?

frontend you can just change the paths and libraries I will just provide you structure first with duplicate branch