fix incorrect default avatar url
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user