Add server-side authentication logic