question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.0.0-beta.5: Allow `whitelistedDomains` to be disabled or specified via wildcards

See original GitHub issue

Our webservice URL is not hard-coded but rather retrieved at runtime, therefore it’s not possible to hard-code our whitelisted domains when importing JwtModule.forRoot().

It would be helpful to be able to disable whitelisting and/or allow for wildcards.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
nischicommented, Feb 19, 2018

I finally found a solution.

export function getToken () { return localStorage.getItem(tokenName); } export const whitelistedDomains = [new RegExp('[\s\S]*')] as RegExp[]; export function jwtOptionsFactory() { return { tokenGetter: getToken, whitelistedDomains: whitelistedDomains }; } In the imports: JwtModule.forRoot({ jwtOptionsProvider: { provide: JWT_OPTIONS, useFactory: jwtOptionsFactory } })

1reaction
ln-ecommented, Oct 19, 2017

Are you using angular-cli/aot?

JwtModule.forRoot({
  config: {
    whitelistedDomains: [new RegExp('regexp'), 'string'],
  }
})

after ng build --prod I get only whitelistedDomains:['string']

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot use wildcard in Access-Control-Allow-Origin when ...
Edit 1: I've been using chrome --disable-web-security , but now want things to actually work. Edit 2: Answer: So, solution for me django-cors-headers...
Read more >
Examples of wildcard characters
Wildcards are special characters that can stand in for unknown characters in a text value and are handy for locating multiple items with...
Read more >
Wildcards and Destination Lists
Every domain in a block or allow destination list has an implied left side and right side wildcard.Note: Asterisks () are not supported....
Read more >
Wildcards in table mapping
This section describes wildcards you can use when specifying the schema and table names for table mapping.
Read more >
How do I add Domain Wildcards to My Block or Allow Lists?
Adding wildcards to your block or allow lists is accomplished by an implied wildcard.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found