passportGithub会调用两次callback
本地没问题，但是在服务器用代理有问题

使用passportGithub的过程中发现可以正确的回调到`/api/v1/passport/github/callback?code=37866e1306e68bbb23bf`，此时可以正确的获取github用户信息，在verify里面进行了用户注册或者获取用户，然后存储到session。

但是通过查看xxx-web.log发现server会收到第二个一模一样的请求，由于code已经被使用了，所以第二次失败返回，前端也会失败
```
name: "AuthenticationError"
message: "Unauthorized"
status: 401
pid: 8204
```
请问如何避免这种情况,  `config.proxy = true;config.passportGithub.proxy = true`也设置了

前端使用nginx做的反向代理
```
    server {
        listen       80;
        server_name  im-client.hezf.online;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

       location / {
          root   /data/static/im-client;
          index  index.html;
          try_files $uri $uri/ /index.html;
        }

        location ~* \.(html)$ {
          root   /data/static/im-client;
          access_log off;
          add_header  Cache-Control  no-store;
        }

        location /static {
          access_log off;
          root   /data/static/im-client;
          gzip on;
          gzip_buffers 32 8K;
          gzip_comp_level 6;
          gzip_min_length 100;
          gzip_types application/javascript text/css text/xml;
          gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件，支持正则。此处表示ie6及以下不启用gzip（因为ie低版本不支持）
          gzip_vary on;
          add_header Cache-Control max-age=2592000;
        }

        location /api {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto http;
          proxy_set_header X-NginX-Proxy true;
          client_max_body_size	100m;
        }

        location /public {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
          client_max_body_size	100m;		
        }

        location /socket.io {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
          client_max_body_size	100m;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

      server {
        listen 443 ssl;
        server_name  im-client.hezf.online;        
        ssl_certificate /etc/nginx/conf.d/hezf-online/im-client.hezf.online_chain.crt;
        ssl_certificate_key /etc/nginx/conf.d/hezf-online/im-client.hezf.online_key.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
        ssl_prefer_server_ciphers on;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

       location / {
          root   /data/static/im-client;
          index  index.html;
          try_files $uri $uri/ /index.html;
        }

        location ~* \.(html)$ {
          root   /data/static/im-client;
          access_log off;
          add_header  Cache-Control  no-store;
        }

        location /static {
          access_log off;
          root   /data/static/im-client;
          gzip on;
          gzip_buffers 32 8K;
          gzip_comp_level 6;
          gzip_min_length 100;
          gzip_types application/javascript text/css text/xml;
          gzip_disable "MSIE [1-6]\."; #配置禁用gzip条件，支持正则。此处表示ie6及以下不启用gzip（因为ie低版本不支持）
          gzip_vary on;
          add_header Cache-Control max-age=2592000;
        }

        location /api {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto https;
          proxy_set_header X-NginX-Proxy true;
          proxy_redirect off;
          client_max_body_size	100m;		
        }

        location /public {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
          client_max_body_size	100m;		
        }

        location /socket.io {
          proxy_pass http://127.0.0.1:7001;			
          proxy_connect_timeout	3;
          proxy_send_timeout		30;
          proxy_read_timeout		30;			
          proxy_set_header X-Forwarded-Host $host;
          proxy_set_header X-Forwarded-Server $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
          client_max_body_size	100m;
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }
```