Skip to content

Commit 57eb078

Browse files
authored
Merge pull request #2338 from dandi/revert-oauth-model
Revert OAuth model change
2 parents 0817a5d + 0259d05 commit 57eb078

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

dandiapi/settings.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,11 @@ def mutate_configuration(configuration: type[ComposedConfiguration]):
201201
AUTO_APPROVE_USERS = False
202202

203203

204+
# NOTE: The staging configuration uses a custom OAuth toolkit `Application` model
205+
# (`StagingApplication`) to allow for wildcards in OAuth redirect URIs (to support Netlify branch
206+
# deploy previews, etc). Note that both the custom `StagingApplication` and default
207+
# `oauth2_provider.models.Application` will have Django database models and will show up on the
208+
# Django admin, but only one of them will be in active use depending on the environment
209+
# the API server is running in (production/local or staging).
204210
class HerokuStagingConfiguration(HerokuProductionConfiguration):
205-
@staticmethod
206-
def mutate_configuration(configuration: type[ComposedConfiguration]):
207-
# The staging configuration enables wildcards in OAuth redirect URIs in order
208-
# to support Netlify deploy previews.
209-
configuration.OAUTH2_PROVIDER['ALLOW_URI_WILDCARDS'] = True
211+
OAUTH2_PROVIDER_APPLICATION_MODEL = 'api.StagingApplication'

0 commit comments

Comments
 (0)