File tree Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Expand file tree Collapse file tree 4 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ func TestSignOut(t *testing.T) {
14
14
15
15
session := loginUser (t , "user2" )
16
16
17
- req := NewRequest (t , "GET " , "/user/logout" )
17
+ req := NewRequest (t , "POST " , "/user/logout" )
18
18
session .MakeRequest (t , req , http .StatusFound )
19
19
20
20
// try to view a private repo, should fail
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ func RegisterRoutes(m *macaron.Macaron) {
399
399
m .Post ("/recover_account" , user .ResetPasswdPost )
400
400
m .Get ("/forgot_password" , user .ForgotPasswd )
401
401
m .Post ("/forgot_password" , user .ForgotPasswdPost )
402
- m .Get ("/logout" , user .SignOut )
402
+ m .Post ("/logout" , user .SignOut )
403
403
})
404
404
// ***** END: User *****
405
405
Original file line number Diff line number Diff line change 109
109
{{end}}
110
110
111
111
<div class="divider"></div>
112
- <a class="item" href="{{AppSubUrl}}/user/logout">
112
+ <a class="item link-action " href data-url ="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/ ">
113
113
<i class="octicon octicon-sign-out"></i>
114
114
{{.i18n.Tr "sign_out"}}<!-- Sign Out -->
115
115
</a>
Original file line number Diff line number Diff line change @@ -2740,11 +2740,14 @@ function showAddAllPopup() {
2740
2740
2741
2741
function linkAction ( ) {
2742
2742
const $this = $ ( this ) ;
2743
+ const redirect = $this . data ( 'redirect' ) ;
2743
2744
$ . post ( $this . data ( 'url' ) , {
2744
2745
_csrf : csrf
2745
2746
} ) . done ( ( data ) => {
2746
2747
if ( data . redirect ) {
2747
2748
window . location . href = data . redirect ;
2749
+ } else if ( redirect ) {
2750
+ window . location . href = redirect ;
2748
2751
} else {
2749
2752
window . location . reload ( ) ;
2750
2753
}
You can’t perform that action at this time.
0 commit comments