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

Await in Scripting Section #419

Closed
twwd opened this issue Mar 23, 2023 · 4 comments
Closed

Await in Scripting Section #419

twwd opened this issue Mar 23, 2023 · 4 comments

Comments

@twwd
Copy link

twwd commented Mar 23, 2023

Hi,

I've implemented a script that asynchronously fetches the OIDC client secret from an API to set it as the oauth2_clientSecret variable. When I try to use as follows it, I've got error {}.

{{
    const { getClientSecret } = require('../../scripts/oidc.js');

    exports.oauth2_clientSecret = await getClientSecret(oidc_url, oauth2_clientId);
}}

Can you give me a hint how to get it to work?

@AnWeber
Copy link
Owner

AnWeber commented Mar 23, 2023

See #398. Maybe I change my opinion about the PR. You are not alone who has trouble with the default behaviour

@twwd
Copy link
Author

twwd commented Mar 23, 2023

My script can also easily be rewritten as ESM if this makes any difference for your plans :)

@AnWeber
Copy link
Owner

AnWeber commented Mar 23, 2023

ESM would not currently work. My problem is actually that I currently do not know what changes will be necessary and I do not want to block the way. You are the third person in the last 2 weeks who wants this feature. Probably I should merge the PR, and see where it leads.

@AnWeber
Copy link
Owner

AnWeber commented Mar 23, 2023

I have released a version with async support. Now it should also be possible directly like your example.

@AnWeber AnWeber closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants