mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-26 05:32:05 +00:00
20 lines
540 B
CoffeeScript
20 lines
540 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}})
|
|
.then () ->
|
|
$scope.state.otherSessions = []
|
|
$scope.state.error = false
|
|
$scope.state.success = true
|
|
.catch () ->
|
|
$scope.state.error = true
|
|
]
|