how can i prevent multiple logins in openedx installed in tutor using latest tutor version how can i prevent it ?
looks to me like there’s a common envs feature flag to do this, set 'PREVENT_CONCURRENT_LOGINS': True,
Thanks for your response but how can it possible in tutor i cant find such file location
@regis do you know if this patch is still effective on Tutor v19? Maybe I wrote my plugin wrong but for me it appears to have no effect, I can login as the same user in multiple devices/browsers. also tried adding it under the following patch directives with no success either.
- openedx-lms-production-settings
- openedx-cms-production-settings
- openedx-lms-common-settings
from tutor import hooks
# Prevent concurrent logins
hooks.Filters.ENV_PATCHES.add_item(
("openedx-common-settings", "FEATURES['PREVENT_CONCURRENT_LOGINS'] = True")
)
As far as I understand, this patch should still be effective. You can check by running:
# should print 'True' when correctly enabled
tutor local run lms ./manage.py lms shell -c "from django.conf import settings; print(settings.FEATURES['PREVENT_CONCURRENT_LOGINS'])"
But whether the feature itself still works, that is an open question… If I’m understanding this piece of code correctly, the session ID should be updated whenever a user logs in, such that previous sessions are no longer valid.
No, what I’m wondering, is whether this feature still works now that we have MFEs… I don’t think MFEs make use of the session ID at all, so users should still be able to browse MFEs from multiple devices. That feature was implemented 11 years ago, so it’s quite possible that it no longer works as expected.
Thanks @regis
That shell command does indicate a True result for me.
It wouldn’t surprise me if it’s related to the MFE, though I’m not keen on rebuilding my server to test without MFE. 11 years is a long time ago, quite possible that’s just an orphaned config that most didn’t know/care about.
Thanks anyway for the feedback
@Muhammed_safnad_ck if you do not have the MFEs installed you could maybe try out that plugin I posted previously, but otherwise I don’t have any other useful suggestions, sorry
Thank you for your time. “I’ll try to follow it