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

feat: async generateStateFunction and checkStateFunction #239

Merged
merged 4 commits into from
Nov 23, 2023

Conversation

NotEvenANeko
Copy link
Contributor

generateStateFunction and checkStateFunction now support async function, fastify instance can be accessed via this.

And the generateAuthorizationUri now returns a Promise<string> due to generateStateFunction can be async, which might be a breaking change.

close #238

Checklist

Test results

❯ pnpm run test
> @fastify/[email protected] test
> npm run test:unit && npm run test:typescript


> @fastify/[email protected] test:unit
> tap

​ PASS ​ test/index.test.js 209 OK 292.476ms


                         
  🌈 SUMMARY RESULTS 🌈  
                         

Suites:   ​1 passed​, ​1 of 1 completed​
Asserts:  ​​​209 passed​, ​of 209​
​Time:​   ​622.737ms
​----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |     100 |      100 |     100 |     100 |                   
 index.js |     100 |      100 |     100 |     100 |                   
----------|---------|----------|---------|---------|-------------------

> @fastify/[email protected] test:typescript
> tsd

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR! Can you please add the new behavior to the docs?

@NotEvenANeko
Copy link
Contributor Author

I forgot to push the commit yesterday, docs added.

@mcollina
Copy link
Member

Can you update the branch? There are conflicts now.

@NotEvenANeko
Copy link
Contributor Author

fixed

@mcollina
Copy link
Member

I'm sorry, there are more conflicts :(

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 6f9616d into fastify:master Nov 23, 2023
19 checks passed
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

Successfully merging this pull request may close these issues.

[Feature Request] Async generateStateFunction
2 participants