public static function getSalt(): string
    {
        $result = '';

        try {
            $result = static::readSaltFromFile();
        } catch (InvalidArgumentException $e) {
            Log::warning("Failed to read salt from file");
        }

        if ($result) {
            return $result;
        }

        try {
            $salt = static::generateSalt();
            static::writeSaltToFile($salt);
            $result = static::readSaltFromFile();
        } catch (InvalidArgumentException $e) {
            throw new InvalidArgumentException("Failed to regenerate and save new salt: " . $e->getMessage(), 0, $e);
        }
        Log::warning("New salt is generated and stored.  Users might need to logout and clean their cookies.");

        return $result;
    }