revert avatar optional encoding
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -54,10 +53,7 @@ func (p *AvatarProxy) Put(u store.User) (avatarURL string, err error) {
|
||||
}()
|
||||
|
||||
// get ID and location of locally cached avatar
|
||||
encID := u.ID // all locally created comments have userID encoded hex, imported extra need encoding.
|
||||
if _, e := strconv.ParseUint(u.ID, 16, 64); e != nil {
|
||||
encID = rest.EncodeID(u.ID)
|
||||
}
|
||||
encID := rest.EncodeID(u.ID)
|
||||
location := p.location(encID) // location adds partion to path
|
||||
|
||||
if _, err = os.Stat(location); os.IsNotExist(err) {
|
||||
|
||||
@@ -23,7 +23,7 @@ func NewGoogle(p Params) Provider {
|
||||
Store: p.SessionStore,
|
||||
MapUser: func(data userData, _ []byte) store.User {
|
||||
userInfo := store.User{
|
||||
ID: rest.EncodeID("google_" + data.value("email")),
|
||||
ID: rest.EncodeID("google_" + data.value("email")), // encode email
|
||||
Name: data.value("name"),
|
||||
Picture: data.value("picture"),
|
||||
Profile: data.value("profile"),
|
||||
@@ -47,7 +47,7 @@ func NewGithub(p Params) Provider {
|
||||
Store: p.SessionStore,
|
||||
MapUser: func(data userData, _ []byte) store.User {
|
||||
userInfo := store.User{
|
||||
ID: rest.EncodeID("github_" + data.value("login")),
|
||||
ID: "github_" + data.value("login"),
|
||||
Name: data.value("name"),
|
||||
Picture: data.value("avatar_url"),
|
||||
Profile: data.value("html_url"),
|
||||
@@ -83,7 +83,7 @@ func NewFacebook(p Params) Provider {
|
||||
Store: p.SessionStore,
|
||||
MapUser: func(data userData, bdata []byte) store.User {
|
||||
userInfo := store.User{
|
||||
ID: rest.EncodeID("facebook_" + data.value("id")),
|
||||
ID: "facebook_" + data.value("id"),
|
||||
Name: data.value("name"),
|
||||
}
|
||||
if userInfo.Name == "" {
|
||||
|
||||
Reference in New Issue
Block a user