-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6: Migrated "auth" directory #947
Conversation
app/script/auth/AuthRepository.js
Outdated
get_cached_access_token() { | ||
return new Promise(((resolve, reject) => { | ||
let access_token = z.util.StorageUtil.get_value(z.storage.StorageKey.AUTH.ACCESS_TOKEN.VALUE); | ||
let access_token_type = z.util.StorageUtil.get_value(z.storage.StorageKey.AUTH.ACCESS_TOKEN.TYPE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
app/script/auth/AuthRepository.js
Outdated
*/ | ||
save_access_token(access_token_data) { | ||
let expires_in_millis = 1000 * access_token_data.expires_in; | ||
let expiration_timestamp = Date.now() + expires_in_millis; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
app/script/auth/AuthRepository.js
Outdated
*/ | ||
_log_access_token_update(access_token_data, expiration_timestamp) { | ||
let expiration_log = z.util.format_timestamp(expiration_timestamp, false); | ||
return this.logger.info(`Saved updated access token. It will expire on: ${expiration_log}`, access_token_data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
app/script/auth/AuthService.js
Outdated
const POST_ACCESS = { | ||
RETRY_LIMIT: 10, | ||
RETRY_TIMEOUT: 500, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be a static property as well or?
app/script/auth/AuthService.js
Outdated
return new Promise((resolve, reject) => { | ||
this.client.request_queue_blocked_state(z.service.RequestQueueBlockedState.ACCESS_TOKEN_REFRESH); | ||
|
||
let config = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be const as well
app/script/auth/AuthRepository.js
Outdated
key: new_user.label_key, | ||
value: new_user.label, | ||
} | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something is off here..
app/script/auth/AuthRepository.js
Outdated
return this.renew_access_token(`Schedule for '${time}'`); | ||
} else { | ||
return this.logger.info(`Access token refresh scheduled for '${time}' skipped because we are offline`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no else returns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do this :)
app/script/auth/AuthService.js
Outdated
|
||
const _retry = () => { | ||
return this.post_access(retry_attempt).then(resolve).catch(reject); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const _retry = () => this.post_access(retry_attempt).then(resolve).catch(reject);
app/script/auth/AuthService.js
Outdated
xhrFields: { | ||
withCredentials: true, | ||
}, | ||
}).done((data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})
.done(...
app/script/auth/AuthService.js
Outdated
}, | ||
}).done((data) => { | ||
resolve(data); | ||
}).fail((jqXHR, textStatus, errorThrown) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
})
.fail(...
* 'dev' of github.com:wireapp/wire-webapp: eslint no-else-return rule (#954) Reenable Firefox 45 for ESR support but disable calling Calling v3 optimizations (WEBAPP-3772) (#937) ES6: Migrated "auth" directory (#947) ES6: Migrated GeoLocation (#951)
Type of change
Screenshot