Skip to content

Commit

Permalink
Revert "UI: remove renew self call after login (#28204) (#28211)"
Browse files Browse the repository at this point in the history
This reverts commit d2d7958.
  • Loading branch information
ryancragun committed Aug 29, 2024
1 parent 7858c9d commit de1e950
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 21 deletions.
3 changes: 0 additions & 3 deletions changelog/28204.txt

This file was deleted.

2 changes: 0 additions & 2 deletions ui/app/components/auth-jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ export default Component.extend({
this.onError(err);
},

// NOTE TO DEVS: Be careful when updating the OIDC flow and ensure the updates
// work with implicit flow. See issue https://github.com/hashicorp/vault-plugin-auth-jwt/pull/192
prepareForOIDC: task(function* (oidcWindow) {
const thisWindow = this.getWindow();
// show the loading animation in the parent
Expand Down
2 changes: 1 addition & 1 deletion ui/app/services/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export default Service.extend({
const now = this.now();
this.set('lastFetch', timestamp);
// if expiration was allowed and we're over half the ttl we want to go ahead and renew here
if (this.allowExpiration && this.renewAfterEpoch && now >= this.renewAfterEpoch) {
if (this.allowExpiration && now >= this.renewAfterEpoch) {
this.renew();
}
this.set('allowExpiration', false);
Expand Down
15 changes: 0 additions & 15 deletions ui/tests/acceptance/auth-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import authForm from '../pages/components/auth-form';
import jwtForm from '../pages/components/auth-jwt';
import { create } from 'ember-cli-page-object';
import { setupMirage } from 'ember-cli-mirage/test-support';
import VAULT_KEYS from 'vault/tests/helpers/vault-keys';

const component = create(authForm);
const jwtComponent = create(jwtForm);
const { rootToken } = VAULT_KEYS;

module('Acceptance | auth', function (hooks) {
setupApplicationTest(hooks);
Expand Down Expand Up @@ -143,17 +141,4 @@ module('Acceptance | auth', function (hooks) {
await component.selectMethod('token');
await click('[data-test-auth-submit]');
});

test('it does not call renew-self after successful login with non-renewable token', async function (assert) {
this.server.post(
'/auth/token/renew-self',
() => new Error('should not call renew-self directly after logging in')
);

await visit('/vault/auth');
await component.selectMethod('token');
await component.token(rootToken);
await click('[data-test-auth-submit]');
assert.strictEqual(currentURL(), '/vault/dashboard');
});
});

0 comments on commit de1e950

Please sign in to comment.