Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Merge PR #2470 (remove old API token exchange) for 2.7 integration testing

Roland Geider82c272125a2b
diff --cc CHANGELOG.md
index df5fad621,1737e3a01..79d8e4d03
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -1,29 -1,5 +1,35 @@@
# Changelog for the next release
+## New features
+
+* Improved openAPI spec. The spec now properly describes the different parts of
+ the API and can be used to generate clients.
+
+### OAuth2 provider
+
+wger can now act as an OAuth2 provider itself, so that other applications can let
+their users log in with their wger account and access the API on their behalf. This
+is switched off by default unless configured, see the docs for the setup.
+
+* <https://wger.readthedocs.io/en/latest/administration/oauth2_provider.html>
+
+## Bug fixes
+
+* Gated progressions (configs with `requirements`) now advance exactly one step
+ per qualifying workout instead of back-filling increments for skipped,
+ non-qualifying iterations
+* Gated progressions now reach configs scheduled for later iterations, so
+ multi-phase plans (e.g. bigger increments from week 6 on) work when the
+ requirements are only met intermittently
+* Ungated configs no longer back-apply increments of earlier gated configs
+ whose requirements were never met
+* Progression requirements are now checked against the rounded values as they
+ are displayed, so reaching the shown prescription always counts
+* The min and max configs of a field now advance together, following the
+ requirements of the base config
++
++## Removed
++
+ * Removed the temporary `/api/v2/issue-refresh-token` endpoint. It existed only
+ so the mobile app could exchange a permanent DRF token for a JWT refresh
+ token. That migration has shipped and the app no longer calls it.
diff --cc wger/core/api/views.py
index 2deee9821,9866eb435..f1d45a917
--- a/wger/core/api/views.py
+++ b/wger/core/api/views.py
@@@ -91,7 -85,7 +91,6 @@@ from wger.core.models import
UserProfile,
WeightUnit,
)
- from wger.utils.headless_long_lived import mint_long_lived_refresh_token
-from wger.utils.permissions import WgerPermission
from wger.utils.powersync import REGISTRY as POWERSYNC_REGISTRY
from wger.version import (
MIN_APP_VERSION,
@@@ -352,44 -336,6 +351,17 @@@ def check_language(request)
return Response({'result': True})
- @extend_schema(
- request=None,
- responses={
- 200: inline_serializer(
- name='RefreshTokenResponse',
- fields={'refresh_token': CharField()},
- ),
- },
- )
- @api_view(['POST'])
- @permission_classes([IsAuthenticated])
- def issue_refresh_token(request):
- """
- Temporary endpoint for issuing refresh tokens for authenticated users.
-
- This endpoint is used to allow users of the mobile app to seamlessly move from
- permanent tokens to JWT ones.
-
- TODO: remove one version after the iniial offline-mode release
- """
- refresh_token = mint_long_lived_refresh_token(
- request.user,
- settings.HEADLESS_JWT_REFRESH_TOKEN_EXPIRES_IN,
- )
- return Response({'refresh_token': refresh_token})
-
-
+@extend_schema(
+ responses={
+ 200: inline_serializer(
+ name='PowersyncTokenResponse',
+ fields={
+ 'token': CharField(),
+ 'powersync_url': CharField(),
+ },
+ ),
+ },
+)
@api_view()
@permission_classes([IsAuthenticated])
def get_powersync_token(request):