Skip to content

Commit

Permalink
fix display login logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Dec 22, 2016
1 parent ff1f38c commit 7e1387a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions httpstaticserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type HTTPStaticServer struct {
Theme string
PlistProxy string
GoogleTrackerId string
AuthType string

indexes []IndexFileItem
m *mux.Router
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func main() {
ss.Title = gcfg.Title
ss.GoogleTrackerId = gcfg.GoogleTrackerId
ss.Upload = gcfg.Upload
ss.AuthType = gcfg.Auth.Type

if gcfg.PlistProxy != "" {
u, err := url.Parse(gcfg.PlistProxy)
Expand Down
2 changes: 2 additions & 0 deletions res/index.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<span class="glyphicon glyphicon-qrcode"></span>
</a>
</li>
[[if eq .AuthType "openid"]]
<li class="hidden-xs">
<a href="/-/logout" v-if="user.email">
<span v-text="user.name"></span>
Expand All @@ -46,6 +47,7 @@
<span class="glyphicon glyphicon-user"></span>
</a>
</li>
[[end]]
</ul>
<form class="navbar-form navbar-right">
<div class="input-group">
Expand Down
2 changes: 1 addition & 1 deletion res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ var vm = new Vue({
method: "get",
dataType: "json",
success: function(ret) {
if (this.user) {
if (ret) {
this.user.email = ret.email;
this.user.name = ret.name;
}
Expand Down

0 comments on commit 7e1387a

Please sign in to comment.