Fixed extension login

This commit is contained in:
Eduard Urbach 2019-11-18 11:55:00 +09:00
parent 93af640d53
commit 2af0fe9e0c
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
4 changed files with 8 additions and 4 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.13
require (
cloud.google.com/go v0.48.0 // indirect
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
github.com/aerogo/aero v1.3.46
github.com/aerogo/aero v1.3.48
github.com/aerogo/api v0.2.3
github.com/aerogo/crawler v0.2.5
github.com/aerogo/flow v0.1.5

6
go.sum
View File

@ -24,8 +24,8 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/aerogo/aero v1.3.29/go.mod h1:nHuG9q4VrzH7ZtiE1TEIt9Lazp/w3WpC3nqAKREkg0Q=
github.com/aerogo/aero v1.3.30/go.mod h1:iAzV2JRnKAFOo/c+4KIgf35JGS82qMU4tI06ocHeRrk=
github.com/aerogo/aero v1.3.46 h1:HbdZ7T70l17wm0mTdp9waqajPgwmv2I4YDaLA03Yuh0=
github.com/aerogo/aero v1.3.46/go.mod h1:KXIh0vmCV1s2rFn4it5MbneyZtXCT6U76m6H0/47bFI=
github.com/aerogo/aero v1.3.48 h1:bwXitk7i3q6upBl2QWIcKilm8GqUMVkk2CeyQ3bnV8A=
github.com/aerogo/aero v1.3.48/go.mod h1:h+szpG2dVvYVXWEJMd3KYkNZU+WcQXUA/aMgm2kGRrk=
github.com/aerogo/api v0.2.3 h1:REQR3a6WXzaHpNSF9NCjj4HjvSQdcHrMWGnp/xIpCh4=
github.com/aerogo/api v0.2.3/go.mod h1:cClK+FXNc0IRGdDxAH5XmtibBxwUXCM2lLKMF7jKB+8=
github.com/aerogo/cluster v0.1.8 h1:N/jU2t7kQfKjXzQIArBQvtNkJCiaP9+jgdEid3P2Omc=
@ -84,6 +84,8 @@ github.com/aerogo/session v0.1.7 h1:Natc9Pq9KIHDUBR/0YjdazckTdOWBItYmuDplGJJfFc=
github.com/aerogo/session v0.1.7/go.mod h1:6/99zuiGm8wzIPFGDlzv3636eLqhWR9cf0rRn/3IRJs=
github.com/aerogo/session v0.1.8 h1:l28Ii/YBfh4/vDWOc1YXLXg2vkHsRFuMLAeVhhl1eME=
github.com/aerogo/session v0.1.8/go.mod h1:Q9QqpT8nM6HTaklE14T+bzNSKrwW1M2wZ/NZV1HUTB0=
github.com/aerogo/session v0.1.9 h1:pgsFEtCteOQaZ/103q2/O+qrqZileiCZe+vboWKZMlU=
github.com/aerogo/session v0.1.9/go.mod h1:dgpdXvs9tZXcag5ay6tEoKuySPga226iSh748uIES/E=
github.com/aerogo/session-store-memory v0.1.8/go.mod h1:z4ZxP+xLVdH69F/Cvgy93v8fWzeDmiJo+Mm+Th3un4c=
github.com/aerogo/session-store-memory v0.1.9 h1:1OswTCtyqzffX5aGr6jI3H8gt/hkU3LKNiKpia7ntcs=
github.com/aerogo/session-store-memory v0.1.9/go.mod h1:z4ZxP+xLVdH69F/Cvgy93v8fWzeDmiJo+Mm+Th3un4c=

View File

@ -1,6 +1,7 @@
package main
import (
"net/http"
"strings"
"github.com/aerogo/aero"
@ -27,6 +28,7 @@ func configure(app *aero.Application) *aero.Application {
// Sessions
app.Sessions.Duration = 3600 * 24 * 30 * 6
app.Sessions.Store = nanostore.New(arn.DB.Collection("Session"))
app.Sessions.SameSite = http.SameSiteNoneMode
// Content security policy
app.ContentSecurityPolicy.Set("img-src", "https: data:")

View File

@ -13,7 +13,7 @@ func Get(ctx aero.Context) error {
user := arn.GetUserFromContext(ctx)
if user == nil {
return ctx.HTML(components.Login(""))
return ctx.HTML(components.Login("_blank"))
}
if !user.HasBasicInfo() {