Signed-off-by: Seongmin Lee git@boltless.me
+6
-14
Diff
round #4
+3
-9
appview/oauth/accounts.go
+3
-9
appview/oauth/accounts.go
···
126
126
}
127
127
}
128
128
129
-
type AuthReturnInfo struct {
130
-
ReturnURL string
131
-
}
132
-
133
129
func (o *OAuth) SetAuthReturn(w http.ResponseWriter, r *http.Request, returnURL string) error {
134
130
session, err := o.SessStore.Get(r, AuthReturnName)
135
131
if err != nil {
···
145
141
return session.Save(r, w)
146
142
}
147
143
148
-
func (o *OAuth) GetAuthReturn(r *http.Request) *AuthReturnInfo {
144
+
func (o *OAuth) GetAuthReturn(r *http.Request) string {
149
145
session, err := o.SessStore.Get(r, AuthReturnName)
150
146
if err != nil || session.IsNew {
151
-
return &AuthReturnInfo{}
147
+
return ""
152
148
}
153
149
154
150
returnURL, _ := session.Values[AuthReturnURL].(string)
155
151
156
-
return &AuthReturnInfo{
157
-
ReturnURL: returnURL,
158
-
}
152
+
return returnURL
159
153
}
160
154
161
155
func (o *OAuth) ClearAuthReturn(w http.ResponseWriter, r *http.Request) error {
+3
-5
appview/oauth/handler.go
+3
-5
appview/oauth/handler.go
···
104
104
}
105
105
}
106
106
107
-
redirectURL := "/"
108
-
if authReturn.ReturnURL != "" {
109
-
redirectURL = authReturn.ReturnURL
107
+
if authReturn == "" {
108
+
authReturn = "/"
110
109
}
111
-
112
-
http.Redirect(w, r, redirectURL, http.StatusFound)
110
+
http.Redirect(w, r, authReturn, http.StatusFound)
113
111
}
114
112
115
113
func (o *OAuth) addToDefaultSpindle(did string) {
History
9 rounds
0 comments
boltless.me
submitted
#8
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
2/3 failed, 1/3 success
expand
collapse
no conflicts, ready to merge
expand 0 comments
boltless.me
submitted
#7
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
2/3 failed, 1/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#6
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
2/3 failed, 1/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#5
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
2/3 failed, 1/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#4
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
2/3 failed, 1/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#3
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
3/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#2
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
1/3 failed, 2/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#1
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>
1/3 failed, 2/3 success
expand
collapse
expand 0 comments
boltless.me
submitted
#0
1 commit
expand
collapse
appview/oauth: remove
AuthReturnInfo
Signed-off-by: Seongmin Lee <git@boltless.me>