Ver Fonte

Remove query string from redirect URL. Auth link opens in same window.

Harry Hedger há 9 anos atrás
pai
commit
676a77c899
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      src/plugins/GoogleDrive.js

+ 2 - 3
src/plugins/GoogleDrive.js

@@ -16,7 +16,6 @@ export default class Google extends Plugin {
     `
     `
 
 
     this.files = []
     this.files = []
-
     this.renderBrowserItem = this.renderBrowserItem.bind(this)
     this.renderBrowserItem = this.renderBrowserItem.bind(this)
     this.filterItems = this.filterItems.bind(this)
     this.filterItems = this.filterItems.bind(this)
     this.filterQuery = this.filterQuery.bind(this)
     this.filterQuery = this.filterQuery.bind(this)
@@ -211,14 +210,14 @@ export default class Google extends Plugin {
    */
    */
   renderAuth () {
   renderAuth () {
     const state = btoa(JSON.stringify({
     const state = btoa(JSON.stringify({
-      redirect: location.href
+      redirect: location.href.split('#')[0]
     }))
     }))
 
 
     const link = `${this.opts.host}/connect/google?state=${state}`
     const link = `${this.opts.host}/connect/google?state=${state}`
     return yo`
     return yo`
       <div class="UppyGoogleDrive-authenticate">
       <div class="UppyGoogleDrive-authenticate">
         <h1>You need to authenticate with Google before selecting files.</h1>
         <h1>You need to authenticate with Google before selecting files.</h1>
-        <a href=${link} target="_blank">Authenticate</a>
+        <a href=${link}>Authenticate</a>
       </div>
       </div>
     `
     `
   }
   }