|
|
@ -559,14 +559,22 @@ export const loadGitHubUserFromToken = async () => { |
|
|
|
dispatch(setGitHubUser(data.user)) |
|
|
|
dispatch(setGitHubUser(data.user)) |
|
|
|
dispatch(setScopes(data.scopes)) |
|
|
|
dispatch(setScopes(data.scopes)) |
|
|
|
dispatch(setUserEmails(data.emails)) |
|
|
|
dispatch(setUserEmails(data.emails)) |
|
|
|
|
|
|
|
sendToGitLog({ |
|
|
|
} |
|
|
|
type: 'success', |
|
|
|
|
|
|
|
message: `Github user loaded...` |
|
|
|
|
|
|
|
}) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
const credentials = await getGitHubCredentialsFromLocalStorage() |
|
|
|
sendToGitLog({ |
|
|
|
if (credentials) { |
|
|
|
type: 'error', |
|
|
|
//dispatch(setGitHubUser({ login: credentials.username }))
|
|
|
|
message: `Please check your GitHub token in the GitHub settings.` |
|
|
|
//dispatch(setUserEmails([{ email: credentials.email, primary: true, visibility: 'public', verified: true }]))
|
|
|
|
}) |
|
|
|
|
|
|
|
dispatch(setGitHubUser(null)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
sendToGitLog({ |
|
|
|
|
|
|
|
type: 'error', |
|
|
|
|
|
|
|
message: `Please check your GitHub token in the GitHub settings.` |
|
|
|
|
|
|
|
}) |
|
|
|
dispatch(setGitHubUser(null)) |
|
|
|
dispatch(setGitHubUser(null)) |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|