Skip to content

Commit

Permalink
backport of commit f4248bf
Browse files Browse the repository at this point in the history
  • Loading branch information
hashishaw authored Feb 9, 2024
1 parent 0560883 commit 6b7b37d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog/25335.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: redirect back to current route after reauthentication when token expires
```
8 changes: 7 additions & 1 deletion ui/app/components/token-expire-warning.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand Down
5 changes: 5 additions & 0 deletions ui/app/components/token-expire-warning.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6b7b37d

Please sign in to comment.