I have a small server written in Haskell, when I send something to it, it should evaluate if the sent content matches a password \"password\" in the auth function but it is
I see a number of issues here.
You should flush Handle after hPutStr h "connected". IIRC the Handle is buffered. So probably everything is ok, but you don't see the connected message on client side because of buffering. (ADDED: use hFlush h)
Some clients (e.g. telnet) uses \r\n as end-of-line mark, but hGetLine expects \n. So you may receive password\r instead of password. Try print msg instead of putStrLn msg to see what exactly you received.