readAuthURL reads the auth URL companion file for the given token path. Returns the URL string, or empty string if the file doesn't exist or can't be read.
(tokenPath string)
| 168 | // Returns the URL string, or empty string if the file doesn't exist or |
| 169 | // can't be read. |
| 170 | func readAuthURL(tokenPath string) string { |
| 171 | data, err := os.ReadFile(tokenPath + ".url") // nolint: gosec |
| 172 | if err != nil { |
| 173 | return "" |
| 174 | } |
| 175 | return strings.TrimSpace(string(data)) |
| 176 | } |
| 177 | |
| 178 | // tryCreateLockFile atomically creates the lock file using O_CREATE|O_EXCL |
| 179 | // and writes the current process's PID and start time into it as JSON. |
no outgoing calls