authn-js icon indicating copy to clipboard operation
authn-js copied to clipboard

React server-side-rendering ReferenceError: document is not defined.

Open fleyai opened this issue 6 years ago • 1 comments

Is there any ways to perform server-side-rendering (ssr)?

Cause now there is err

` /node_modules/keratin-authn/dist/keratin-authn.js:167 document.addEventListener('visibilitychange', function () { ^

ReferenceError: document is not defined at new SessionManager (node_modules/keratin-authn/dist/keratin-authn.js:167:9) at Object. (node_modules/keratin-authn/dist/keratin-authn.js:322:15) at Module._compile (internal/modules/cjs/loader.js:689:30) at Module._compile (node_modules/pirates/lib/index.js:83:24) at Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Object.newLoader [as .js] (node_modules/pirates/lib/index.js:88:7) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17)

`

fleyai avatar Dec 27 '18 10:12 fleyai

@fleyai I'm unsure what AuthN would be able to accomplish during SSR, since it would not have access to the session refresh token or localstorage. Any ideas?

cainlevy avatar Jan 08 '19 17:01 cainlevy