Skip to content

Commit

Permalink
Handle the case where session expired
Browse files Browse the repository at this point in the history
  • Loading branch information
srenault committed Oct 6, 2017
1 parent bf5b93b commit f369152
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/communication.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
return new Promise((resolve, reject) => {
request.post(url, options, (err, xhr, body) => {
if (err) {
reject();
reject(xhr.statusCode);
return;
}
if (xhr.statusCode === 200 || Math.floor(xhr.statusCode / 100) === 3) {
Expand All @@ -24,7 +24,7 @@ export default {
});
} else resolve();
} else {
reject(body, xhr.statusCode);
reject(xhr.statusCode);
}
});
});
Expand Down
4 changes: 2 additions & 2 deletions lib/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ async function createWithDomain(base, domain, args, customTypes, users, noconfir
eventuallyCreateRepository = queryCreateRepositoryWithCookie(base, domain, cookies, customTypes, users);
}

eventuallyCreateRepository.then(() => {
return eventuallyCreateRepository.then(() => {
Helpers.UI.display(`You can access your backend here: ${Helpers.Domain.repository(base, domain)}`);
return domain;
}).catch((body, statusCode) => {
}).catch((statusCode) => {
if (statusCode === 401) {
// remove cookie
return configuration.set({ cookies: '' }).then(() => (
Expand Down

0 comments on commit f369152

Please sign in to comment.