use postgres and redirect logouts