password.js 852 B

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