Yubico / php-yubico

PHP class for Yubico authentication
https://developers.yubico.com/php-yubico
BSD 3-Clause "New" or "Revised" License
129 stars 41 forks source link

Use of flush() function prevents modification of header #29

Open benjaminas opened 4 years ago

benjaminas commented 4 years ago

Function function _make_curl_handle($query, $timeout=null) calls function flush(); This function modifies headers. And then it is not possible to modify headers (redirect pages etc) in main php code that uses Yubico library. After validzteing the password I get PHP Warning: Cannot modify header information - headers already sent in /home/benjaminas/new.velsiga.lt/htdocs/login.php on line . I have traced the problem and that was fush() function. After commenting this function everything works fine. Authentications works fine and I'm able to modify headers in my main program.

Why does this function needs to flush all the buffer before calling curl?

shijij commented 4 years ago

same issue here. the flush() broke my login redirection as well.