UI: Redirect after logging in from token expiry (#25335)

* Redirect after logging in from token expiry. Fixes #10963

* Add changelog
This commit is contained in:
Chelsea Shaw
2024-02-09 12:38:55 -06:00
committed by GitHub
parent fe56069f67
commit f4248bf16c
3 changed files with 15 additions and 1 deletions

3
changelog/25335.txt Normal file
View File

@@ -0,0 +1,3 @@
```release-note:improvement
ui: redirect back to current route after reauthentication when token expires
```

View File

@@ -10,7 +10,13 @@
Your auth token expired on
{{date-format @expirationDate "MMMM do yyyy, h:mm:ss a"}}. You will need to re-authenticate.
</A.Description>
<A.Link::Standalone @icon="arrow-right" @iconPosition="trailing" @text="Reauthenticate" @route="vault.cluster.logout" />
<A.Link::Standalone
@icon="arrow-right"
@iconPosition="trailing"
@text="Reauthenticate"
@route="vault.cluster.logout"
@query={{this.queryParams}}
/>
</Hds::Alert>
{{else}}
<section class="section">

View File

@@ -36,6 +36,11 @@ export default class TokenExpireWarning extends Component {
yield this.handleRenew();
}
get queryParams() {
// Bring user back to current page after login
return { redirect_to: this.router.currentURL };
}
get showWarning() {
const currentRoute = this.router.currentRouteName;
if ('vault.cluster.oidc-provider' === currentRoute) {