File tree 4 files changed +6
-3
lines changed 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 @@ -413,7 +413,7 @@ func RegisterRoutes(m *macaron.Macaron) {
413
413
m .Post ("/recover_account" , user .ResetPasswdPost )
414
414
m .Get ("/forgot_password" , user .ForgotPasswd )
415
415
m .Post ("/forgot_password" , user .ForgotPasswdPost )
416
- m .Get ("/logout" , user .SignOut )
416
+ m .Post ("/logout" , user .SignOut )
417
417
})
418
418
// ***** END: User *****
419
419
Original file line number Diff line number Diff line change 115
115
{{end}}
116
116
117
117
<div class="divider"></div>
118
- <a class="item" href="{{AppSubUrl}}/user/logout">
118
+ <a class="item link-action " href data-url ="{{AppSubUrl}}/user/logout" data-redirect="{{AppSubUrl}}/ ">
119
119
{{svg "octicon-sign-out" 16}}
120
120
{{.i18n.Tr "sign_out"}}<!-- Sign Out -->
121
121
</a>
Original file line number Diff line number Diff line change @@ -2741,11 +2741,14 @@ function showAddAllPopup() {
2741
2741
2742
2742
function linkAction ( ) {
2743
2743
const $this = $ ( this ) ;
2744
+ const redirect = $this . data ( 'redirect' ) ;
2744
2745
$ . post ( $this . data ( 'url' ) , {
2745
2746
_csrf : csrf
2746
2747
} ) . done ( ( data ) => {
2747
2748
if ( data . redirect ) {
2748
2749
window . location . href = data . redirect ;
2750
+ } else if ( redirect ) {
2751
+ window . location . href = redirect ;
2749
2752
} else {
2750
2753
window . location . reload ( ) ;
2751
2754
}
You can’t perform that action at this time.
0 commit comments