'OneDrive Picker redirect back to my site in react Application

I'm using the OneDrive Picker documentation from here but it doesn't work. Firstly I needed to add a redirect Url otherwise the login page that is opened says it can't log me in. Then what happens is that the page that is displayed is actually my website with an access token in the Uri for 1 sec after that remove token from the url:

enter image description here

I have also use:

<ReactOneDriveFilePicker
                            clientID='*****66-ac23-**f2-957e-9c5941a1*****'
                            action="share"
                            multiSelect={false}
                            onSuccess={(result) => {
                              alert(JSON.stringify(result));
                            }}
                            onCancel={(result) => {
                              localStorage.removeItem("ClientID")
                              alert(JSON.stringify(result));
                            }}
                          >
                      <Button color="primary" className="form-control" >
                        <div className="row">
                          <div className="col-3">
                            <FontAwesomeIcon className="icon" icon={faImages} />
                          </div>
                          <div className="col-9">Select from OneDrive</div>
                        </div>
                      </Button>
</ReactOneDriveFilePicker>  

but I got same issue after signin in onedrive redirect back my site.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source