mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-23 02:11:01 +00:00
fixed logout
This commit is contained in:
parent
ff82ed2454
commit
782914b46f
5 changed files with 15 additions and 2 deletions
|
@ -43,6 +43,7 @@
|
|||
<script src="/static/scripts/controllers/sync.js"></script>
|
||||
<script src="/static/scripts/controllers/main.js"></script>
|
||||
<script src="/static/scripts/controllers/login.js"></script>
|
||||
<script src="/static/scripts/controllers/logout.js"></script>
|
||||
<script src="/static/scripts/services/auth.js"></script>
|
||||
<script src="/static/scripts/services/conf.js"></script>
|
||||
<script src="/static/scripts/services/repo.js"></script>
|
||||
|
|
|
@ -41,7 +41,12 @@ app.config(['$routeProvider', '$locationProvider', '$httpProvider', function($ro
|
|||
.when('/login', {
|
||||
templateUrl: '/static/views/login.html',
|
||||
controller: 'LoginController',
|
||||
title: 'Login',
|
||||
title: 'Login'
|
||||
})
|
||||
.when('/logout', {
|
||||
templateUrl: '/static/views/logout.html',
|
||||
controller: 'LogoutController',
|
||||
title: 'Logout'
|
||||
})
|
||||
.when('/gitlab', {
|
||||
templateUrl: '/static/views/login_gitlab.html',
|
||||
|
|
7
server/app/scripts/controllers/logout.js
Normal file
7
server/app/scripts/controllers/logout.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('app').controller("LogoutController", function() {
|
||||
console.log("logging out")
|
||||
localStorage.removeItem("access_token");
|
||||
window.location.href = "/login";
|
||||
});
|
|
@ -7,5 +7,5 @@
|
|||
<li ng-if="user.admin == true"><a href="/admin/users"><i class="fa fa-users"></i> Users</a></li>
|
||||
<li ng-if="user.admin == true"><a href="/admin/settings"><i class="fa fa-cog"></i> Settings</a></li>
|
||||
</ul>
|
||||
<a href="/logout" class="signout" target="_self">Signout <i class="fa fa-sign-out"></i></a>
|
||||
<a href="/logout" class="signout">Signout <i class="fa fa-sign-out"></i></a>
|
||||
</div>
|
0
server/app/views/logout.html
Normal file
0
server/app/views/logout.html
Normal file
Loading…
Reference in a new issue