fix incorrect default avatar url

This commit is contained in:
Umputun
2018-03-20 01:54:21 -05:00
parent dadb3666af
commit 6a647f6f63
4 changed files with 7 additions and 7 deletions
-1
View File
@@ -123,7 +123,6 @@ func main() {
SessionStore: sessionStore,
Providers: makeAuthProviders(sessionStore, avatarProxy),
AvatarProxy: avatarProxy,
DevEnabled: opts.DevPasswd != "",
DevPasswd: opts.DevPasswd,
},
Cache: rest.NewLoadingCache(4*time.Hour, 15*time.Minute, postFlushFn),
+3 -5
View File
@@ -20,15 +20,13 @@ type Authenticator struct {
Admins []string
Providers []Provider
DevEnabled bool
DevPasswd string
DevPasswd string
}
var devUser = store.User{
ID: "dev",
Name: "developer one",
Picture: "https://friends.radio-t.com/resources/images/rt_logo_64.png",
Profile: "https://radio-t.com/info/",
Profile: "https://remark42.com",
Admin: true,
}
@@ -106,7 +104,7 @@ func (a *Authenticator) AdminOnly(next http.Handler) http.Handler {
func (a *Authenticator) basicDevUser(w http.ResponseWriter, r *http.Request) bool {
if a.DevPasswd == "" || !a.DevEnabled {
if a.DevPasswd == "" {
return false
}
+1 -1
View File
@@ -126,7 +126,7 @@ func (p *AvatarProxy) Routes() (string, chi.Router) {
// Default returns full default avatar url
func (p *AvatarProxy) Default() string {
return path.Join(p.RemarkURL, p.RoutePath, p.DefaultAvatar)
return strings.TrimRight(p.RemarkURL, "/") + p.RoutePath + "/" + p.DefaultAvatar
}
// get location for user id by adding partion to final path in order to keep files
+3
View File
@@ -102,6 +102,9 @@ PUT {{host}}/api/v1/notify?site=remark&url=https://radio-t.com/p/2017/12/16/podc
### subscribtion status
GET {{host}}/api/v1/notify?site=remark&url=https://radio-t.com/p/2017/12/16/podcast-576/
### get default avatar
GET {{host}}/api/v1/avatar/blah
### ping
GET {{host}}/ping