Commit bb81564
authored
feat: adopt OAuth2-style token fields in authentication responses (#347)
* feat: adopt OAuth2-style token fields in authentication responses
- Replace token response fields with OAuth2-style fields: access_token, token_type, expires_in, refresh_token, and scope
- Add a test assertion to verify that refresh_token is present and not empty in the response
fix #346
Signed-off-by: Bo-Yi Wu <[email protected]>
* fix: improve refresh token handling and update related tests
- Add error handling and response for refresh token generation failures during middleware initialization
- Return the actual refresh token in the response instead of an empty string
- Update test claims to include standard JWT fields with current timestamps
- Change test code to extract access_token instead of token from responses
- Remove redundant test assertions for refresh_token presence
Signed-off-by: Bo-Yi Wu <[email protected]>
---------
Signed-off-by: Bo-Yi Wu <[email protected]>1 parent 892b627 commit bb81564
2 files changed
+36
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
359 | 367 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
363 | 373 | | |
364 | 374 | | |
365 | 375 | | |
| |||
374 | 384 | | |
375 | 385 | | |
376 | 386 | | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
377 | 395 | | |
378 | | - | |
379 | | - | |
380 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
381 | 401 | | |
382 | 402 | | |
383 | 403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
718 | 718 | | |
719 | 719 | | |
720 | 720 | | |
721 | | - | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
722 | 729 | | |
723 | 730 | | |
724 | 731 | | |
| |||
780 | 787 | | |
781 | 788 | | |
782 | 789 | | |
783 | | - | |
| 790 | + | |
784 | 791 | | |
785 | 792 | | |
786 | 793 | | |
| |||
799 | 806 | | |
800 | 807 | | |
801 | 808 | | |
802 | | - | |
| 809 | + | |
803 | 810 | | |
804 | 811 | | |
805 | 812 | | |
| |||
0 commit comments