Commit Graph

57 Commits

Author SHA1 Message Date
Roland Geider
3dc83e1759 Harden the jwt token strategy against None-Users 2026-06-24 12:43:32 +02:00
Roland Geider
bb21c47c7b Bump default EXERCISE_CACHE_TTL 2026-06-19 14:24:50 +02:00
Roland Geider
df894f6161 Merge pull request #2359 from wger-project/feature/version-2.6
Version 2.6
2026-06-17 09:32:23 +02:00
Roland Geider
63e8f9c86b Allow linking the user's account to a social provider 2026-06-15 14:34:06 +02:00
Roland Geider
c68b3e958c Remove unsued settings 2026-06-14 22:12:41 +02:00
Roland Geider
9421e90b04 Set a maximum limit for pagination sizes 2026-06-14 22:12:41 +02:00
Roland Geider
0ff2e5d9ea Add throttling for exercise creation 2026-06-14 12:44:14 +02:00
Roland Geider
6a5ab0696b Generate and work with keys with pyjwt, python_jose is not needed anymore 2026-06-04 13:52:31 +02:00
Roland Geider
3cd525392e Merge feature/more-allauth into feature/version-2.6
# Conflicts:
#	CHANGELOG.md
#	pyproject.toml
#	uv.lock
#	wger/core/api/serializers.py
#	wger/core/forms.py
#	wger/core/tests/test_user_login.py
#	wger/core/views/user.py
2026-05-27 16:30:16 +02:00
Roland Geider
5c2707b000 Remove the /api/v2/register/ endpoint as well 2026-05-24 19:31:56 +02:00
Roland Geider
1f7f40539f Merge branch 'master' into fix/ingredient-thumbnails 2026-05-22 12:22:26 +02:00
Roland Geider
2ad2dec5a1 Add translation file for Macedonian
There is already some translation made for the frontend
2026-05-22 11:23:44 +02:00
Roland Geider
4bb74414c8 Add Romanian to language fixture
The translation already existed...
2026-05-22 11:23:44 +02:00
Roland Geider
556c43d0ad Consolidate JWT Keys 2026-05-18 17:07:16 +02:00
Roland Geider
2015824450 Remove SOCIALACCOUNT_PROVIDERS, this is configured in the DB 2026-05-18 17:07:15 +02:00
Roland Geider
79fe03c855 Remove dj-rest-auth, this wasn't used anymore 2026-05-18 17:07:15 +02:00
Roland Geider
3431ea5fba Fix tests and post-rebase cleanup 2026-05-18 17:07:15 +02:00
Roland Geider
a21223a807 Allow users to manually generate JWT tokens 2026-05-18 17:05:00 +02:00
Roland Geider
0473afe7c6 Start adding the allauth headless app for API authentication 2026-05-18 17:05:00 +02:00
Roland Geider
e48a6460dc Cleanup and refactor the social auth login code
Provider settings live now completely in the SocialApp.settings field, which
makes this much more flexible as local administrators can choose which providers
they want to support without us having to keep a list in the settings.

The `USE_SOCIAL_AUTH` setting was removed in favor of the WGER_SOCIAL_PROVIDERS
list, which simply contains the desired list of providers.

The setup_social_oauth.py management command was deleted, users are referred to
the documentation, which explains how to save the different entries
2026-05-18 17:05:00 +02:00
pankaj-basnet
b3044dad07 feat(oauth): add USE_GOOGLE_AUTH setting for allauth, auto-derive USE_SOCIAL_AUTH
As suggested by maintainer rolandgeider, add a dedicated USE_GOOGLE_AUTH
setting. USE_SOCIAL_AUTH is now auto-derived (True if any provider is
enabled) rather than being set manually.

This pattern scales cleanly when GitHub and Facebook are added in future
PRs — each provider gets its own flag, and USE_SOCIAL_AUTH stays in sync.

Files changed:
- settings/settings_global.py: add USE_GOOGLE_AUTH to WGER_SETTINGS
  defaults, remove USE_GITHUB_AUTH/USE_FACEBOOK_AUTH, auto-derive
  USE_SOCIAL_AUTH from provider flags
- settings/main.py: read USE_GOOGLE_AUTH from env, remove
  USE_GITHUB_AUTH/USE_FACEBOOK_AUTH env reads, add auto-derive logic
- settings/local_dev.py: set USE_GOOGLE_AUTH=True, remove github/facebook
  flags, add auto-derive logic
- settings/ci.py: set USE_GOOGLE_AUTH=False, remove github/facebook flags
2026-05-18 17:05:00 +02:00
pankaj-basnet
777c3b928d feat(auth): add Google, GitHub and Facebook OAuth support 2026-05-18 17:05:00 +02:00
pankaj-basnet
c572d3e35e fix(auth): hide Google OAuth behind configuration flag
- Add GOOGLE_OAUTH_ENABLED to WGER_SETTINGS in settings_global.py
- Conditionally include socialaccount apps in INSTALLED_APPS
- Wrap dj-rest-auth and allauth social URLs in setting checks
- Update setup_google_oauth command to guard against disabled state
- Add context processor variable to toggle UI login buttons
2026-05-18 17:05:00 +02:00
pankaj-basnet
10e26e40d2 Feat: Implement dj-rest-auth for Google OAuth API endpoints
- Add dj-rest-auth to dependencies
- Register SocialLoginView for Google OAuth callback via REST
- Map dj-rest-auth URLs in wger/urls.py for mobile/headless auth
- Maintain compatibility with existing allauth template-based login
2026-05-18 17:05:00 +02:00
pankaj-basnet
73fc3c6bc6 Feat: Implement Google OAuth using django-allauth for user authentication 2026-05-18 17:04:59 +02:00
Roland Geider
51510bdb97 Add two-factor authentication 2026-05-18 17:04:59 +02:00
Roland Geider
b4cf3d47ac Replace the registration view with allauth's 2026-05-18 17:04:59 +02:00
Roland Geider
a19f3bdeb1 Replace the login view with allauth's 2026-05-18 17:04:59 +02:00
Roland Geider
ae767543ed Move the email changing logic to allauth
This also takes care of having to deal with the data of two forms in the prefs
2026-05-18 17:04:59 +02:00
Roland Geider
a9b96bf7d0 Replace our own EmailAuthBackend with allauth's AuthenticationBackend 2026-05-18 17:04:59 +02:00
Roland Geider
af1aeee204 Move the email changing logic to allauth
This also takes care of having to deal with the data of two forms in the prefs

# Conflicts:
#	settings/settings_global.py

Fixes #2342
2026-05-18 10:58:45 +02:00
Roland Geider
9d705eef3e Remove unused thumbnail sizes
These were not being used and were using many GB on the official server
2026-05-17 22:11:17 +02:00
Roland Geider
f3cdf9f61d Fix links to readthedocs 2026-05-13 19:51:23 +02:00
Roland Geider
a33f47a1a7 Refactor and improve jwt and regular api key handling 2026-05-08 15:21:19 +02:00
Roland Geider
72abb103b4 Set default URL for SYNC_INGREDIENTS_DUMP_URL in settings
This is more robust since currently the sync URL is made from a local setting
which can be changed (this is a todo for another day)
2026-04-28 17:20:48 +02:00
Roland Geider
00eb981945 Add throttling for ingredient endpoints to protect against high load 2026-04-28 11:59:18 +02:00
Roland Geider
d06180e4f4 Properly register postgres-specific behaviour
Fixes #2304
2026-04-20 11:49:12 +02:00
Roland Geider
e2e257dc24 Add tasks to periodically generate the ingredient export 2026-04-10 21:28:07 +02:00
Roland Geider
80cd7d2139 Merge pull request #2260 from pankaj-basnet/feature/2258-migrate-to-django-allauth
Feat: Replace django-email-verification with django-allauth (#2258)
2026-03-29 15:57:45 +02:00
Roland Geider
821a2f4ae6 Use correct setting name 2026-03-28 23:40:21 +01:00
Roland Geider
ccef34409b Remove the django-email-verification dependency 2026-03-28 17:20:37 +01:00
Roland Geider
e950f3b572 For completeness, add STORAGES key to settings_global.py 2026-03-28 16:44:27 +01:00
Roland Geider
4873f939c0 Add account adapter
This allows us to pass the expiration time for the verification emails
2026-03-28 14:14:55 +01:00
Roland Geider
40ca8a0dee Improve handling of deleted or uploaded media files
Simply calling .delete() takes care of deletion of entries in the local filesystem
of uploaded to some cloud storage if that option is used. Also, move the S3 options
from global settings so they can be used with the docker setup.
2026-03-23 20:23:36 +01:00
pankaj-basnet
bc8740e9b7 integrate allauth add_email and verification into user preferences (#2258) 2026-03-23 16:26:51 +05:45
pankaj-basnet
d18a20908d remove django-email-verification package code (github issue=2258) 2026-03-22 01:11:37 +05:45
Roland Geider
ce11ab08cc Add configurable captcha score and set widget actions 2026-02-25 11:49:00 +01:00
Roland Geider
ef74611653 Fix formatting 2026-02-24 20:00:53 +01:00
Github-actions
57e6923f2c Automatic linting 2026-01-18 12:06:40 +00:00
Roland Geider
c5281d2665 Formatting 2026-01-18 12:27:22 +01:00