Skip to content

Commit 7a89b98

Browse files
author
Sachin Maheshwari
committed
typo
1 parent 5ad6c36 commit 7a89b98

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/connector-wrapper.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ const proxyCall = function() {
3838
function request() {
3939
return new Promise((resolve, reject) => {
4040
function receiveMessage(e) {
41+
console.log("Received at auth-lib:", e)
4142
const safeFormat = e.data.type === "SUCCESS" || e.data.type === "FAILURE"
4243
if (safeFormat) {
4344
window.removeEventListener('message', receiveMessage)
4445
if (e.data.type === "SUCCESS") {
4546
const token = getToken('v3jwt')
4647
token ? resolve({ token: token }) : reject("v3jwt cookie not found")
47-
} else {
48-
reject("unable to refesh token")
48+
}
49+
if (e.data.type === "FAILURE") {
50+
reject("unable to get refesh token")
4951
}
5052
}
5153
}
52-
54+
5355
window.addEventListener('message', receiveMessage)
5456

5557
const payload = { type: "REFRESH_TOKEN" }

web-assets/js/setupAuth0WithRedirect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ const authSetup = function () {
420420
const success = {
421421
type: "SUCCESS"
422422
};
423-
if (e.type === "REFRESH_TOKEN") {
423+
if (e.data.type === "REFRESH_TOKEN") {
424424
auth0.isAuthenticated().then(function (isAuthenticated) {
425425
auth0.getTokenSilently().then(function (token) {
426426
storeToken();

0 commit comments

Comments
 (0)