diff --git a/assets/src/utils/auth.js b/assets/src/utils/auth.js index 290b0ed3..a5130c91 100644 --- a/assets/src/utils/auth.js +++ b/assets/src/utils/auth.js @@ -1,14 +1,14 @@ import cookie from './cookie' import store from '@/store' import router from '@/router' +import { Base64 } from 'js-base64' function parseToken (token) { let path = store.state.baseURL if (path === '') path = '/' document.cookie = `auth=${token}; max-age=86400; path=${path}` let res = token.split('.') - let user = JSON.parse(window.atob(res[1])) - + let user = JSON.parse(Base64.decode(res[1])) if (!user.commands) { user.commands = [] } diff --git a/package.json b/package.json index b798cb48..a82b09fd 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "clipboard": "^1.7.1", "codemirror": "^5.31.0", "filesize": "^3.5.11", + "js-base64": "^2.4.0", "moment": "^2.19.2", "normalize.css": "^7.0.0", "noty": "^3.1.3", diff --git a/rice-box.go.REMOVED.git-id b/rice-box.go.REMOVED.git-id deleted file mode 100644 index 8bd4542a..00000000 --- a/rice-box.go.REMOVED.git-id +++ /dev/null @@ -1 +0,0 @@ -474eed09fbf9deaa03192fe70126e083536dad7e \ No newline at end of file