password.js 791 B

12345678910111213141516171819202122232425262728293031323334
  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. 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. }