File tree 3 files changed +6
-5
lines changed
3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 9
9
10
10
document . addEventListener ( "DOMContentLoaded" , ( ) => {
11
11
const logoutButton = document . getElementById ( "logout-button" ) ;
12
- logoutButton . addEventListener ( "click" , event => {
12
+ const logoutUrl = logoutButton . dataset . logoutUrl ;
13
+ logoutButton . addEventListener ( "click" , ( ) => {
13
14
event . preventDefault ( ) ;
14
- utils . doLogout ( ) ;
15
+ utils . doLogout ( logoutUrl ) ;
15
16
} ) ;
16
17
} ) ;
Original file line number Diff line number Diff line change @@ -463,12 +463,12 @@ function changeBulkDeleteStates(table) {
463
463
}
464
464
}
465
465
466
- function doLogout ( ) {
466
+ function doLogout ( url ) {
467
467
$ . ajax ( {
468
468
url : "/api/auth" ,
469
469
method : "DELETE" ,
470
470
} ) . always ( function ( ) {
471
- globalThis . location = "/admin/login" ;
471
+ globalThis . location = url ;
472
472
} ) ;
473
473
}
474
474
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ mg.include('header.lp','r')
87
87
<a class ="btn-link" href ="https://github.com/pi-hole" rel ="noopener" target ="_blank" ><i class ="fa-fw menu-icon fab fa-github" ></i > GitHub </a >
88
88
<a class ="btn-link" href ="https://discourse.pi-hole.net/c/announcements/5" rel ="noopener" target ="_blank" ><i class ="fa-fw menu-icon fa-solid fa-rocket" ></i > Pi -hole Releases </a >
89
89
<? if pihole .needLogin () then ?>
90
- <a class ="btn-link" href ="#" id ="logout-button" ><i class ="fa-fw menu-icon fa-solid fa-arrow-right-from-bracket" ></i > Log out </a >
90
+ <a class ="btn-link" href ="#" id ="logout-button" data - logout - url = "<?=pihole.webhome() .. '/login'?>" ><i class ="fa-fw menu-icon fa-solid fa-arrow-right-from-bracket" ></i > Log out </a >
91
91
<? end ?>
92
92
</li >
93
93
</ul >
You can’t perform that action at this time.
0 commit comments