summaryrefslogtreecommitdiff
path: root/Creds.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-20 12:46:33 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-20 12:46:33 -0400
commit7c01390d8bca54c00d1b832070956d3707052605 (patch)
treebaa451cc4af7b52c6e6150dcb79012b9cb185e8b /Creds.hs
parentb46eb75c7647719ed586bbe1a447033090a36526 (diff)
webapp: Fix UI for removing XMPP connection.
Diffstat (limited to 'Creds.hs')
-rw-r--r--Creds.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Creds.hs b/Creds.hs
index 0586f2070..7273ed966 100644
--- a/Creds.hs
+++ b/Creds.hs
@@ -14,6 +14,7 @@ module Creds (
getEnvCredPair,
writeCacheCreds,
readCacheCreds,
+ removeCreds,
) where
import Common.Annex
@@ -138,3 +139,9 @@ decodeCredPair :: Creds -> Maybe CredPair
decodeCredPair creds = case lines creds of
l:p:[] -> Just (l, p)
_ -> Nothing
+
+removeCreds :: FilePath -> Annex ()
+removeCreds file = do
+ d <- fromRepo gitAnnexCredsDir
+ let f = d </> file
+ liftIO $ nukeFile f