Ok so this problem was actually caused by the JetPack plugin from wordpress. Actually if JetPack is deactivated, the facebook login redirection works perfect. When JetPack is enabled with sharing, then facebook login does not work. Hmm! this seems a core problem for the dev.