Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

realmSecretResolver async #125

Closed
On365 opened this issue Apr 19, 2022 · 2 comments
Closed

realmSecretResolver async #125

On365 opened this issue Apr 19, 2022 · 2 comments
Assignees
Labels
Type: Enhancement New feature or request

Comments

@On365
Copy link

On365 commented Apr 19, 2022

is it possible to change this option so that the return can come from an async function? I made the change, to be able to put async but it's not getting the secret when it needs it.

multiTenant: {
realmResolver: (request) => {
console.log(realmResolver:${request.get('host').split('.')[0]});
return request.get('host').split('.')[0];
},
realmSecretResolver: async (realm) => {
const account = await this.getSecret(realm); //database
return account.client_secret;
},
},

@ferrerojosh
Copy link
Owner

This is a good enhancement. Thanks! This might break other users who don't use async so I'll implement it with a fallback.

@ferrerojosh ferrerojosh self-assigned this Apr 20, 2022
@ferrerojosh ferrerojosh added the Type: Enhancement New feature or request label Apr 20, 2022
@On365
Copy link
Author

On365 commented Apr 20, 2022

Thank you so much. I will test and give feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants