refactor: 💡 auth payloads now have "attributes" field

This commit is contained in:
Randall Morey committed 2021-04-01 17:41:30 -04:00
1 parent 6927008041
commit 3d13d8f412
11 files changed
+74 -218

No files matched your search

@@ -26,13 +26,11 @@ module('Unit | Authenticator | password', function (hooks) {
test('it adds an authorization header to application adapter on restore', async function (assert) {
assert.expect(1);
const mockData = { id: 'token1234', token: 'token1234' };
this.server.get(
authenticator.buildTokenValidationEndpointURL(mockData.id),
() => {
return new Response(200);
}
);
const id = 'token1234';
const mockData = { attributes: { id, token: 'token1234' } };
this.server.get(authenticator.buildTokenValidationEndpointURL(id), () => {
return new Response(200);
});
authenticator.restore(mockData);
assert.equal(applicationAdapter.headers.Authorization, 'Bearer token1234');
});