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

API communication w/ Login #24

Merged
merged 24 commits into from
Nov 21, 2023
Merged

API communication w/ Login #24

merged 24 commits into from
Nov 21, 2023

Conversation

delano
Copy link
Contributor

@delano delano commented Nov 21, 2023

Two new images named Dog-Sideways-Glare-1024x1024.png and Dog-Sideways-Glare-1536x1025.png have been added to the assets directory.
In the ApplicationPage.vue, the import of CatHeartImage has been replaced with defaultAvatar.
The reference to CatHeartImage has been replaced with defaultAvatar in two objects named user and guestUser.
In LoginView.vue and RegisterView.vue, replaced the image source from Cat-Heart-680x800-1.png to Dog-Sideways-Glare-1024x1024.png.
Which resulted in the image updates on the login and register pages.

Signed-off-by: delano [email protected]

.mts to resolve Typescript <=> ESM tomfoolery with Vite+Vue+Tailwind.

See links inline.

Signed-off-by: delano <[email protected]>
tsconfig.json

Cont'd from c054a31.

Signed-off-by: delano <[email protected]>
Will revisit again in future as ultimately the component approach
is the most powerful. See VueJS docs for 3 ways to implement forms.

Signed-off-by: delano <[email protected]>
Fixed type warning in LoginView.vue.

Signed-off-by: delano <[email protected]>
Note: If you're using Vue 3 with vue-i18n, make sure to install the
vue-i18n@next version, which includes support for Vue 3 and TypeScript.

Signed-off-by: delano <[email protected]>
All day on CSRF. Only some of these changes will be helpful to keep.
To be picked through after getting a working DRF goingvia cookiecutter.

Signed-off-by: delano <[email protected]>
venv3.11 ❯ cookiecutter gh:cookiecutter/cookiecutter-django
You've downloaded /Users/d/.cookiecutters/cookiecutter-django before. Is it okay to delete and re-download it? [y/n] (y):
  [1/27] project_name (My Awesome Project): AFB Requests
  [2/27] project_slug (afb_requests):
  [3/27] description (Behold My Awesome Project!): Food
  [4/27] author_name (Daniel Roy Greenfeld): delbo
  [5/27] domain_name (example.com):
  [6/27] email ([email protected]): [email protected]
  [7/27] version (0.1.0):
  [8/27] Select open_source_license
    1 - MIT
    2 - BSD
    3 - GPLv3
    4 - Apache Software License 2.0
    5 - Not open source
    Choose from [1/2/3/4/5] (1): 1
  [9/27] Select username_type
    1 - username
    2 - email
    Choose from [1/2] (1): 2
  [10/27] timezone (UTC):
  [11/27] windows (n):
  [12/27] Select editor
    1 - None
    2 - PyCharm
    3 - VS Code
    Choose from [1/2/3] (1): 3
  [13/27] use_docker (n):
  [14/27] Select postgresql_version
    1 - 15
    2 - 14
    3 - 13
    4 - 12
    5 - 11
    6 - 10
    Choose from [1/2/3/4/5/6] (1):
  [15/27] Select cloud_provider
    1 - AWS
    2 - GCP
    3 - Azure
    4 - None
    Choose from [1/2/3/4] (1):
  [16/27] Select mail_service
    1 - Mailgun
    2 - Amazon SES
    3 - Mailjet
    4 - Mandrill
    5 - Postmark
    6 - Sendgrid
    7 - SendinBlue
    8 - SparkPost
    9 - Other SMTP
    Choose from [1/2/3/4/5/6/7/8/9] (1):
  [17/27] use_async (n):
  [18/27] use_drf (n): y
  [19/27] Select frontend_pipeline
    1 - None
    2 - Django Compressor
    3 - Gulp
    4 - Webpack
    Choose from [1/2/3/4] (1):
  [20/27] use_celery (n):
  [21/27] use_mailpit (n): y
  [22/27] use_sentry (n): y
  [23/27] use_whitenoise (n): y
  [24/27] use_heroku (n):
  [25/27] Select ci_tool
    1 - None
    2 - Travis
    3 - Gitlab
    4 - Github
    5 - Drone
    Choose from [1/2/3/4/5] (1): 4
  [26/27] keep_local_envs_in_vcs (y): n
  [27/27] debug (n):
 [SUCCESS]: Project initialized, keep up the good work!

Signed-off-by: delano <[email protected]>
Signed-off-by: delano <[email protected]>
Out of the box with cookiecutter. Just created a new superuser for afb_requests app (separate sqlite files)

Signed-off-by: delano <[email protected]>
Not setting the Access-Control-Allow-Origin for the preflight request (OPTIONS)

Signed-off-by: delano <[email protected]>
Login is functioning:
- submitting form to API
- getting token
- adding token to requests

Signed-off-by: delano <[email protected]>
Modified parts of our Django application settings to enable the use of sessions for CSRF and configured the token to expire after two weeks. Removed user registration and login view paths in the urls.py and replaced it with different path settings. Included new imports in users.py and deleted the RegisterView class while adding new methods in the UserViewSet class. Also integrated token-based authentication into the interceptor of our axios instance in ApplicationPage.vue and updated console log messages. Added a new route for logout in index.ts. Auth store has been refactored to simplify authentication state management.

Signed-off-by: delano <[email protected]>
- This update includes significant changes to the router configuration and a new HomePageView component. A route for "/" is added, which uses the new HomePageView. This view displays information about the Animal Food Bank and indicates whether authentication is required.
- Moreover, an authentication check was also implemented in the router setup and it redirects to the login page if a route is marked as requiring authentication and the user is currently not authenticated. Other changes include code standardization and refactoring operations for cleaner code structure.

Signed-off-by: delano <[email protected]>
- In the `DashboardView.vue` template, the placeholder image was replaced with an interactive table. This table displays a list of people along with their contact details, pets, location and the status of their requests.
- Test data for people was also added to this file.
- Likewise, adjustments were made to the `HomePageView.vue` template to reformat the introductory text about the Animal Food Bank.

All these changes were aimed at enhancing the overall user interface and specifically, how data is presented.

Signed-off-by: delano <[email protected]>
Two new images named `Dog-Sideways-Glare-1024x1024.png` and `Dog-Sideways-Glare-1536x1025.png` have been added to the assets directory.
In the `ApplicationPage.vue`, the import of CatHeartImage has been replaced with `defaultAvatar`.
The reference to `CatHeartImage` has been replaced with `defaultAvatar` in two objects named `user` and `guestUser`.
In `LoginView.vue` and `RegisterView.vue`, replaced the image source from `Cat-Heart-680x800-1.png` to `Dog-Sideways-Glare-1024x1024.png`.
Which resulted in the image updates on the login and register pages.

Signed-off-by: delano <[email protected]>
@delano delano added the feature A planned and/or designed feature in the pipeline label Nov 21, 2023
@delano delano self-assigned this Nov 21, 2023
@delano delano merged commit 85b0395 into main Nov 21, 2023
1 of 2 checks passed
@delano delano deleted the wip/drf-via-cookiecutter branch November 21, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A planned and/or designed feature in the pipeline
Projects
Status: ✔️ Done
Development

Successfully merging this pull request may close these issues.

1 participant