Skip to content

Commit 684d819

Browse files
Merge pull request #588 from ryanmwright/patch-1
Validate self when calling crypto provider
2 parents 90a52b0 + eb978bc commit 684d819

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

projects/lib/src/oauth-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
21942194
let size = 45;
21952195
let id = '';
21962196

2197-
const crypto = self.crypto || self['msCrypto'];
2197+
const crypto = typeof self === 'undefined' ? null : (self.crypto || self['msCrypto']);
21982198
if (crypto) {
21992199
let bytes = new Uint8Array(size);
22002200
crypto.getRandomValues(bytes);

0 commit comments

Comments
 (0)