password.js 748 B

1234567891011121314151617181920212223242526272829303132333435
  1. import getMeta from '@/utils/meta'
  2. const MOCK_DELAY = 1000
  3. export function defaultSetupMocks(fetchMock) {
  4. fetchMock.post(
  5. /\/user\/password\/update/,
  6. {
  7. status: 200,
  8. body: {
  9. message: {
  10. type: 'success',
  11. email: 'tim.alby@overleaf.com',
  12. text: 'Password changed',
  13. },
  14. },
  15. },
  16. {
  17. delay: MOCK_DELAY,
  18. }
  19. )
  20. }
  21. export function setDefaultMeta() {
  22. Object.assign(getMeta('ol-ExposedSettings'), {
  23. isOverleaf: true,
  24. })
  25. window.metaAttributesCache.set('ol-isExternalAuthenticationSystemUsed', false)
  26. window.metaAttributesCache.set('ol-hasPassword', true)
  27. window.metaAttributesCache.set('ol-passwordStrengthOptions', {
  28. length: {
  29. min: 2,
  30. },
  31. })
  32. }