mockoauthstate.js 732 B

12345678910111213141516171819202122232425
  1. module.exports = () => {
  2. return {
  3. generateState: () => 'some-cool-nice-encrytpion',
  4. addToState: () => 'some-cool-nice-encrytpion',
  5. getFromState: (state, key) => {
  6. if (state === 'state-with-invalid-instance-url') {
  7. return 'http://localhost:3452'
  8. }
  9. if (state === 'state-with-older-version' && key === 'clientVersion') {
  10. return '@uppy/companion-client=1.0.1'
  11. }
  12. if (state === 'state-with-newer-version' && key === 'clientVersion') {
  13. return '@uppy/companion-client=1.0.3'
  14. }
  15. if (state === 'state-with-newer-version-old-style' && key === 'clientVersion') {
  16. return 'companion-client:1.0.2'
  17. }
  18. return 'http://localhost:3020'
  19. },
  20. }
  21. }