Skip to content

feat: add custom ApiContext auth recovery service - #3131

Merged
JuliaMV merged 3 commits into
developfrom
feature/custom-auth-recovery
Sep 22, 2026
Merged

JuliaMV merged 3 commits into
developfrom
feature/custom-auth-recovery

Conversation

@siarhei-epam

@siarhei-epam siarhei-epam commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added a public IAuthRecoveryService contract for authentication recovery strategies.
  • Added an optional authRecoveryService prop to ApiContext and useUuiServices.
  • ApiContext now creates the supplied recovery service instead of the default AuthRecoveryService.
  • The default popup-based relogin flow remains unchanged when no custom service is provided.
  • Custom services only need to implement tryToRecover; init and destroy are optional.

Usage

A custom service receives the existing AuthRecoveryContextProps, including
onSuccessAuthRecovery. After authentication is restored, it calls this
callback so ApiContext can resume and retry queued requests.

This allows applications with host-owned authentication, such as federated
modules, to implement token refresh without using the default relogin popup.

Documentation

  • Added a documented example of a custom auth recovery service.
  • Exported AuthRecoveryContextProps and IAuthRecoveryService from
    @epam/uui-core.
  • Added an unreleased changelog entry.

Testing

  • yarn test -- --runInBand
  • yarn eslint
  • yarn track-bundle-size

@siarhei-epam siarhei-epam self-assigned this Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown

Generated by: track-bundle-size
Generated at: Tue, 22 Sep 2026 11:58:36 GMT
Bundle size diff (in kBytes). Not gzipped. Both CSS & JS included.
Baseline: v6.3.1 (2025-12-03)
CI Status: ok

Module Baseline Size
(v6.3.1)
Size Diff Within
Threshold
Threshold
(min - max)
templateApp 693.09 691.94 -1.14
js:-4.14
css:+3
🆗 623.78 - 762.39
@epam/app 5586.96 5538.63 -48.33
js:-54.05
css:+5.72
🆗 5028.26 - 6145.65
@epam/electric 5.04 5.04 0
js:0
css:0
🆗 4.53 - 5.54
@epam/promo 55.61 55.62 0
js:+0.04
css:-0.05
🆗 50.05 - 61.17
@epam/uui-extra 0.21 0.21 0
js:0
css:0
🆗 0.19 - 0.23
@epam/loveship 92.81 96.31 +3.5
js:+3.53
css:-0.02
🆗 83.53 - 102.09
@epam/uui-components 257.49 263.03 +5.54
js:+4.02
css:+1.52
🆗 231.75 - 283.25
@epam/uui-core 324.75 330.98 +6.23
js:+6.23
css:0
🆗 292.27 - 357.23
@epam/uui-db 41.63 41.72 +0.08
js:+0.08
css:0
🆗 37.47 - 45.8
@epam/uui-docs 181.03 194.73 +13.71
js:+13.71
css:0
🆗 162.92 - 199.13
@epam/uui-editor 174.1 173.26 -0.83
js:-0.83
css:0
🆗 156.69 - 191.51
@epam/uui-timeline 75.5 75.49 -0.01
js:0
css:0
🆗 67.95 - 83.05
@epam/uui 527.51 561.49 +33.99
js:+11.09
css:+22.9
🆗 474.76 - 580.26
new sizes (raw)

To set the sizes as a new baseline, you can copy/paste next content to the uui-build/config/bundleSizeBaseLine.json and commit the file.

{
  "version": "6.5.2",
  "timestamp": "2026-09-22",
  "sizes": {
    "templateApp": {
      "css": 260539,
      "js": 448009
    },
    "@epam/app": {
      "css": 726373,
      "js": 4945183
    },
    "@epam/electric": {
      "css": 2275,
      "js": 2883
    },
    "@epam/promo": {
      "css": 47756,
      "js": 9191
    },
    "@epam/uui-extra": {
      "css": 0,
      "js": 213
    },
    "@epam/loveship": {
      "css": 55355,
      "js": 43269
    },
    "@epam/uui-components": {
      "css": 25151,
      "js": 244197
    },
    "@epam/uui-core": {
      "css": 0,
      "js": 338925
    },
    "@epam/uui-db": {
      "css": 0,
      "js": 42718
    },
    "@epam/uui-docs": {
      "css": 2153,
      "js": 197256
    },
    "@epam/uui-editor": {
      "css": 12948,
      "js": 164476
    },
    "@epam/uui-timeline": {
      "css": 2198,
      "js": 75104
    },
    "@epam/uui": {
      "css": 222187,
      "js": 352782
    }
  }
}

Generated by: generate-components-api
CI Status: ok

Total amount of exported types/props without JSDoc comments

Amount
Types 341 (+0) 🆗
Props 220 (+0) 🆗

@siarhei-epam
siarhei-epam force-pushed the feature/custom-auth-recovery branch from cf3c131 to 9c56a72 Compare September 22, 2026 11:03
@siarhei-epam siarhei-epam changed the title feat: add custom ApiContext auth recovery feat: add custom ApiContext auth recovery service Sep 22, 2026
@JuliaMV
JuliaMV force-pushed the feature/custom-auth-recovery branch from 14b9f6b to 265d0e8 Compare September 22, 2026 11:48
@JuliaMV
JuliaMV merged commit d2dedb1 into develop Sep 22, 2026
4 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.

2 participants