mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
21 lines
543 B
CoffeeScript
21 lines
543 B
CoffeeScript
|
define [
|
||
|
"base"
|
||
|
], (App) ->
|
||
|
App.controller "ClearSessionsController", ["$scope", "$http", ($scope, $http) ->
|
||
|
|
||
|
$scope.state =
|
||
|
otherSessions: window.otherSessions
|
||
|
error: false
|
||
|
success: false
|
||
|
|
||
|
$scope.clearSessions = () ->
|
||
|
console.log ">> clearing all sessions"
|
||
|
$http({method: 'POST', url: "/user/sessions/clear", headers: {'X-CSRF-Token': window.csrfToken}})
|
||
|
.success () ->
|
||
|
$scope.state.otherSessions = []
|
||
|
$scope.state.error = false
|
||
|
$scope.state.success = true
|
||
|
.error () ->
|
||
|
$scope.state.error = true
|
||
|
]
|