Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
fix: auth checks that github is used before fetch github mail
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Sep 14, 2021
1 parent ceaa887 commit 45de13e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
6 changes: 3 additions & 3 deletions mixins/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ export default {
let email = _get(this, '$store.state.auth.user.email')

if ([username, id].every(Boolean)) {
// if github user set their email as 'private', email ends up 'null' here
// so we have to fetch it via the API
if (!email) {
if (!email && this.$store.state.config.editor.github) {
// if github user set their email as 'private', email ends up 'null' here
// so we have to fetch it via the API
const headers = { headers: { authorization: this.$auth.getToken(strategy) } }
const result = await axios.get('https://api.github.com/user/emails', headers)
email = _get(result, 'data[0].email') || `${tmp}-unknown@example.com`
Expand Down
8 changes: 0 additions & 8 deletions plugins/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,3 @@ Vue.filter('formatTime', (date) => {
const timePart = d.substring(dateTimeSeparator + 1, d.indexOf('.'))
return `${datePart} ${timePart}`
})

// export default async ({ store }) => {
// const owner = _get(store, 'state.config.editor.github.owner', '')
// const repo = _get(store, 'state.config.editor.github.repo', '')
// Vue.filter('forgeLink', (id) => {
// return `https://github.com/${owner}/${repo}/pull/${id}`
// })
// }

0 comments on commit 45de13e

Please sign in to comment.