Page MenuHomePhabricator

Test without account
Closed, ResolvedPublic

Description

You should be able to try the demo version without having a wiki account. Everything should ideally look like it does when you're logged in with an account, but make it clear that you're not.

This should be configurable by the maintainer. Once the tool is used in production you probably want to require an account.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Add support for anonymous user to test the tool.repos/wmse/wikispeech/speech-data-collector!3viktoriahillerudwmsetest-without-accountmain
Customize query in GitLab

Event Timeline

A first step was to make sure that the user doesn't need to log in. In another patch, or even in another story, we could handle how an anonymous user sends their data to be stored, since as of right now, that is also handled by authentication and the creation of a Profile.

First I got an error about a missing config variable. This should be documented in the sample config. Adding that with the value yes (not sure if that's right) I still see the login screen. How do you get this to work?

Ah sorry, I only made the .env.localhost.example, I will sure add the NO_ACCOUNT variable to config.ini.sample as well. The value is a boolean, so it should be true/false.

Now I added NO_ACCOUNT= # boolean to config.ini.sample

I realized there was just a small hint in the settings.py: ALLOW_ANONYMOUS = config.getboolean("WIKIMEDIA_OAUTH", "NO_ACCOUNT"), so now it should be clearer in the config sample

Ah, I missed adding the variable in .env. Now I can record all the way to the review step where publishing fails.

If you reload the page you need to create a profile again. This is probably fine for now. At some point we should make it look a bit nicer, but I think that can wait until we have a better idea of what we want it to look like.

A small thing to make it clear you're not actually logged in can be to remove the login button. I did a quick hack and this seems to work:

diff --git a/front-end/src/views/RecordWizardView.vue b/front-end/src/views/RecordWizardView.vue
index 6924286..997e5d1 100644
--- a/front-end/src/views/RecordWizardView.vue
+++ b/front-end/src/views/RecordWizardView.vue
@@ -9,7 +9,7 @@
         <RibbonNotice :displayType="'icon'" />
         <LanguageMenuSelector />
         <div class="w-fit">
-          <LoginButton v-if="!isLoading" :is-authenticated="isAuthenticated" />
+          <LoginButton v-if="!isLoading && !isAnonymous" :is-authenticated="isAuthenticated" />
         </div>
       </div>
     </div>
@@ -111,6 +111,7 @@ const store = useRecordWizardStore()
 const { tm } = useI18n()
 const isAuthenticated = ref(false)
 const isLoading = ref(true)
+const isAnonymous = ref(import.meta.env.VITE_ALLOW_ANONYMOUS)
 const router = useRouter()
 const route = useRoute()
 const localeStore = useLocaleStore()

A bigger issue is that now I can't log in is I set the anonymous variables to false. The backend log doesn't show anything more than

Unauthorized: /oauth/verify/wikimedia/
[10/Jun/2026 07:45:12] "POST /oauth/verify/wikimedia/ HTTP/1.1" 401 243

Did this work for you?

I realized this problem probably is fixed now after I rebased onto main. Seems like this change Make Commons URL in the backend configurable was missing. Now instead, it only loads after clicking on "Allow" when trying to login with OAuth though, but this could be the same problem we're having with Beta Wikimedia OAuth being a bit buggy.

It would be interesting to see if you get the same thing now, but hopefully you won't get the Unauthorized: /oauth/verify/wikimedia/ anymore.

I think it makes sense to actually prioritizing in make this task work, since there is a lot of problems with Beta wikimedia right now, and if we want to continue developing the tool without relying on whether Beta OAuth is struggling, then this is a good start.

I can start without logging in, but a lot of the later steps fail. This is probably because it needs to find things (like languages) from the profile.

Can you specify which steps fails and what happens? Was it the step "Recording List"? Choosing the "Local list" -> "List/swe" works fine, but Wikimedia Category with sv.wikipedia does not.

I was wrong. I hadn't added a profile. I already have one that just says "0 languages". Trying to edit that doesn't work, but adding a new one kinda does. At least it allows me to continue.

It doesn't save the profile however. Here's from the backend:

Internal Server Error: /api/locutors/my
Traceback (most recent call last):
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
    return view_func(request, *args, **kwargs)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/django/views/generic/base.py", line 105, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 497, in dispatch
    self.initial(request, *args, **kwargs)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 414, in initial
    self.perform_authentication(request)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 324, in perform_authentication
    request.user
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/request.py", line 231, in user
    self._authenticate()
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/.venv/lib/python3.10/site-packages/rest_framework/request.py", line 384, in _authenticate
    user_auth_tuple = authenticator.authenticate(self)
  File "/home/sebastian/workspace/wikispeech/speech-data-collector/lingualibre/authentication.py", line 13, in authenticate
    if settings.ALLOW_ANONYMOUS:
NameError: name 'settings' is not defined
[15/Jun/2026 16:23:38] "POST /api/locutors/my HTTP/1.1" 500 112881

The NameError: name 'settings' is not defined was caused by settings not being imported correctly in authentication.py, it's now imported directly.

The Next button now works once the required fields are filled in, which it didnt before because the profile form was never shown in anonymous mode. LocutorStep.vue checks store.locutors.length != 0 to decide whether to render the form, but in anonymous mode the locutors array is always empty, so the form, and the watch that enables the Next button, never triggered.

The profile won't be saved to the database (expected behavior for anonymous users), but you can still continue through all the steps.