Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getUserEmail() {
- return getStorageValue('apiHost'
- ).then(function (result) {
- return fetch(result.apiHost + 'api/get_user_email',
- {credentials:'include'}
- ).then(function (response) {
- if (response.ok) {
- return response.json()
- }
- return response.json().then(function (json) {
- throw json
- });
- }).then(function (data) {
- return data.user_email
- }
- ).catch(function (error) {
- console.warn(error)
- });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement