• Robert Knight's avatar
    Fetch access tokens and add Authorization header to API requests · 4b03e69d
    Robert Knight authored
    Remove the global HTTP interceptor provided by angular-jwt which added
    the Authorization header to API requests and replace it with explicit
    logic in `createAPICall` to do the same thing.
    
    This will enable replacing the JWT tokens with opaque access tokens when
    using a publisher-provided grant token for authentication.
    
    It also provides a more explicit way to only include the access token
    with requests to the API, rather than filtering based on the URL prefix
    of the request in the `tokenGetter` implementation.
    
     * Remove angular-jwt's HTTP interceptor and replace it with logic in
       store.js to explicitly fetch an access token using the `auth` module
       and add an Authorization header to API requests.
    
     * Convert standalone functions and global variables in auth.js to
       methods on the auth service. This will enable swapping out the
       current auth service implementation which uses cookies + CSRF
       for authentication with one that uses the OAuth grant token.
    
     * Fix several cases in store-test.js where functions that made
       assertions inside Promise callbacks did not explicitly wait for the
       Promise to resolve before finishing the test.
    4b03e69d
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
npm-shrinkwrap.json Loading commit data...
package.json Loading commit data...