Update sha256 import to be default import (#10468)

This should fix the "Failed to compile. ./node_modules/keycloak-js/dist/keycloak.mjs
Can't import the named export 'sha256' from non EcmaScript module (only default export is available)" error.

Closes #10314
This commit is contained in:
Luc Berger 2022-02-25 17:51:34 +00:00 committed by GitHub
parent 0353f9d7ae
commit c93fee0c68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import base64 from 'base64-js'; import base64 from 'base64-js';
import { sha256 } from 'js-sha256'; import sha256 from 'js-sha256';
if (typeof Promise === 'undefined') { if (typeof Promise === 'undefined') {
throw Error('Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.'); throw Error('Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.');