feat: 🎸 switch to new token type parameter (#1082)
Boundary is deprecating the use of the token_type parameter to the Authenticate endpoint, instead replacing it with the new type parameter. See https://github.com/hashicorp/boundary/commit/80b2c9230fa84605d9aaf7c862f780b50690a36e for more context. Co-authored-by: Randall Morey <randall@randallmorey.com> Co-authored-by: Carlos Alcaide Corvo <ccorvo@hashicorp.com>
This commit is contained in:
2 files changed
+4
-4
No files matched your search
@@ -57,7 +57,7 @@ export default class PasswordAuthenticator extends BaseAuthenticator {
|
||||
) {
|
||||
const body = JSON.stringify({
|
||||
command: 'login',
|
||||
token_type: requestCookies ? 'cookie' : null,
|
||||
type: requestCookies ? 'cookie' : null,
|
||||
attributes: { login_name, password },
|
||||
});
|
||||
const authEndpointURL = this.buildAuthEndpointURL(options);
|
||||
|
||||
@@ -14,7 +14,7 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
authenticator.buildAuthEndpointURL(),
|
||||
(schema, request) => {
|
||||
const json = JSON.parse(request.requestBody);
|
||||
assert.ok(json.token_type, 'Requested token cookies by default');
|
||||
assert.ok(json.type, 'Requested token cookies by default');
|
||||
return new Response(200);
|
||||
}
|
||||
);
|
||||
@@ -30,7 +30,7 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
authenticator.buildAuthEndpointURL(),
|
||||
(schema, request) => {
|
||||
const json = JSON.parse(request.requestBody);
|
||||
assert.notOk(json.token_type, 'Did not request tokens cookies');
|
||||
assert.notOk(json.type, 'Did not request tokens cookies');
|
||||
return new Response(200);
|
||||
}
|
||||
);
|
||||
@@ -48,7 +48,7 @@ module('Unit | Authenticator | password', function (hooks) {
|
||||
const json = JSON.parse(request.requestBody);
|
||||
assert.deepEqual(json, {
|
||||
command: 'login',
|
||||
token_type: 'cookie',
|
||||
type: 'cookie',
|
||||
attributes: {
|
||||
login_name: 'foo',
|
||||
password: 'bar',
|
||||
|
||||
Reference in new issue
Block a user