Skip to content

Commit b7ac17b

Browse files
authored
Merge pull request #71 from LCOGT/fix/public-data-logged-out
Do not add undefined api token to headers of request to archive API
2 parents 46fb590 + a283280 commit b7ac17b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $.ajax({
5050

5151
// Add the archive token to a request being sent to the archive api or the thumbservice
5252
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
53-
if ((options.url.startsWith(store.state.urls.archiveApi) || options.url.startsWith(store.state.urls.thumbnailService)) && store.state.profile) {
53+
if ((options.url.startsWith(store.state.urls.archiveApi) || options.url.startsWith(store.state.urls.thumbnailService)) && store.state.profile.tokens.api_token) {
5454
jqXHR.setRequestHeader('Authorization', 'Token ' + store.state.profile.tokens.api_token);
5555
}
5656
});

0 commit comments

Comments
 (0)