summaryrefslogtreecommitdiff
path: root/pkg/vpn/bonafide/auth_sip.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/vpn/bonafide/auth_sip.go')
-rw-r--r--pkg/vpn/bonafide/auth_sip.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkg/vpn/bonafide/auth_sip.go b/pkg/vpn/bonafide/auth_sip.go
index 0c8ee4f..5da562d 100644
--- a/pkg/vpn/bonafide/auth_sip.go
+++ b/pkg/vpn/bonafide/auth_sip.go
@@ -70,25 +70,27 @@ func writeToken(token []byte) {
tp := getTokenPath()
err := ioutil.WriteFile(tp, token, 0600)
if err != nil {
- log.Println("BUG: cannot write token to", tp)
+ log.Println("BUG: cannot write token to", tp, err)
}
}
func readToken() ([]byte, error) {
f, err := os.Open(getTokenPath())
if err != nil {
- log.Println("Error: cannot open token file")
+ log.Println("Error: cannot open token file", err)
return nil, err
}
token, err := ioutil.ReadAll(f)
if err != nil {
- log.Println("Error: cannot read token")
+ log.Println("Error: cannot read token", err)
return nil, err
}
return token, nil
}
func hasRecentToken() bool {
+ /* See https://0xacab.org/leap/bitmask-vpn/-/issues/346 for ability to refresh tokens,
+ when implemented that should be tried in a goroutine */
statinfo, err := os.Stat(getTokenPath())
if err != nil {
return false