{{ site.WebsiteName }}
{% endblock %} diff --git a/templates/privacy.html b/templates/privacy.html index 106520c..4d60147 100644 --- a/templates/privacy.html +++ b/templates/privacy.html @@ -23,26 +23,45 @@2. Who We Are (Data Controller)
3. The Information We Collect
-We collect very limited personal information - when you log in using your GitHub or Google account:
+{% if auth_provider == "Auth0" %} +We collect limited personal information when you log in using Auth0, our third-party authentication provider:
- - Google/GitHub User - ID: When you log in using the third-party authentication service (Google or - GitHub), we retrieve your user name and ID number and store only your unique user ID number. This is a - persistent identifier provided - by the third party. + User ID: When you log in using Auth0 (which supports authentication via Google, GitHub, + or other identity providers), we receive and store your unique user ID from Auth0. This is a persistent + identifier that allows us to recognize you on subsequent visits. + +
- + Email Address: We receive your email address from Auth0 to identify your account. + +
- + Name: We may receive your name from Auth0 as provided by your chosen identity provider.
- Session Data: We use a session cookie to maintain your logged-in status. This cookie - itself stores a secure, random string (session ID) that links back to your user ID & name on our server. The + stores a secure, random string (session ID) that links back to your user information on our server. The + data is only stored for the duration of your visit (session). + +
We do not collect additional personal details such as location, browsing history, + or any other information beyond what is necessary for authentication and service provision.
+{% else %} +We collect very limited personal information when you log in using your GitHub account:
+-
+
- + GitHub User ID: When you log in using GitHub authentication, we retrieve your + user name and ID number and store only your unique user ID number. This is a persistent identifier + provided by GitHub. + +
- + Session Data: We use a session cookie to maintain your logged-in status. This cookie + stores a secure, random string (session ID) that links back to your user ID & name on our server. The data is only stored for the duration of your visit (session). -
We do not collect your - name, email address, profile picture, location, or any other personal details unless explicitly stated - here.
+We do not collect your email address, profile picture, location, or any other personal + details unless explicitly stated here.
+{% endif %}4. How We Use Your Information
We use the collected information for the @@ -65,18 +84,40 @@
4. How We Use Your Information
analytics, or any other non-essential purpose.5. Third-Party Data Sharing
-We use a third-party service for - authentication:
+{% if auth_provider == "Auth0" %} +We use third-party services for authentication and these services process your data:
+-
+
- + Auth0 (by Okta): We use Auth0 as our authentication service provider. When you log in, + Auth0 handles the authentication process and provides us with your user ID, email, and name. Auth0 acts + as a data processor on our behalf. Auth0 may store additional information about your authentication sessions. + Please review the Auth0 Privacy Policy + for details on how they handle your data. + +
-
+ Identity Providers (Google, GitHub, etc.): When you choose to log in via Google, GitHub,
+ or another identity provider through Auth0, you interact with their services. These providers authenticate
+ your identity and share limited information with Auth0, which then shares it with us. Please review their
+ respective privacy policies:
+
- Google Privacy Policy +
- GitHub Privacy Statement +
We do not share your information with any other third parties for marketing or other purposes.
+{% else %} +We use a third-party service for authentication:
- - GitHub/Google: When you log in, you interact with their - services. They provide us with your unique user ID. Please review the GitHub Privacy - Statement or Google Privacy Policy for details on - how they handle your data. + GitHub: When you log in, you interact with GitHub's authentication service. + They provide us with your unique user ID and username. Please review the + GitHub Privacy Statement + for details on how they handle your data.
We do not share your information with any other - third parties.
+We do not share your information with any other third parties.
+{% endif %}6. Our Cookie Policy
We only use strictly
@@ -126,7 +167,15 @@ 7. Your Data Protection Rights
UK Information Commissioner's Office (ICO) if you believe we
have not handled your information correctly.
8. Data Retention
+We retain your user ID, email, and name for as long as your account is active. If you wish to delete your + account and associated data, please contact us at the email address provided above.
+ +9. Updates to this Policy
+{% else %}8. Updates to this Policy
+{% endif %}We may update this policy from time to time. The latest version will always be posted on this page.
{% endblock %} \ No newline at end of file diff --git a/todo.py b/todo.py index d6361a6..d9b460c 100644 --- a/todo.py +++ b/todo.py @@ -1,26 +1,29 @@ # todo.py - todo functionality from flask import Blueprint, render_template, request, redirect, session + +# models.py from flask_sqlalchemy import SQLAlchemy -from dataclasses import dataclass +from sqlalchemy.orm import DeclarativeBase, MappedAsDataclass, Mapped, mapped_column +from sqlalchemy import ForeignKey from auth import get_current_user + +# Base that adds dataclass behaviors to mapped classes +class Base(MappedAsDataclass, DeclarativeBase): + pass + + todo_bp = Blueprint('todo', __name__) -db = SQLAlchemy() +db = SQLAlchemy(model_class=Base) -@dataclass class Todo(db.Model): - id: int - task: str - done: bool - user_id: str - - __tablename__ = 'todos' + __tablename__ = "todos" - id = db.Column(db.Integer, primary_key=True) - task = db.Column(db.String(200), nullable=False) - done = db.Column(db.Boolean, default=False) - user_id = db.Column(db.String(100), nullable=False) + id: Mapped[int] = mapped_column(primary_key=True, init=False) + task: Mapped[str] = mapped_column(db.String(200), nullable=False) + user_id: Mapped[str] = mapped_column(db.String(100), nullable=False) + done: Mapped[bool] = mapped_column(db.Boolean, default=False) @todo_bp.route('/') @@ -66,3 +69,8 @@ def init_app(app): db.init_app(app) with app.app_context(): db.create_all() + + if Todo.query.count() == 0: + mreggleton = Todo(task="Mr Eggleton checking your Todo App!", done=False, user_id="github|5987806") + db.session.add(mreggleton) + db.session.commit() \ No newline at end of file