From d077241f09b0f5852be9d75a547ed72f8ddd813f Mon Sep 17 00:00:00 2001 From: atagulalan Date: Wed, 10 Apr 2019 17:36:46 +0300 Subject: [PATCH] Fixed Github OAuth name error --- api/oauth_github_callback.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/oauth_github_callback.go b/api/oauth_github_callback.go index ae75bc8..0f56dce 100644 --- a/api/oauth_github_callback.go +++ b/api/oauth_github_callback.go @@ -84,13 +84,11 @@ func githubCallbackHandler(w http.ResponseWriter, r *http.Request) { email = user["email"].(string) } - if user["name"] == nil { - fmt.Fprintf(w, "Error: no name returned by Github") - return + name := user["login"].(string) + if user["name"] != nil { + name = user["name"].(string) } - name := user["name"].(string) - link := "undefined" if user["html_url"] != nil { link = user["html_url"].(string)