From 58dd812008bcbddfe3725c8408d16286729864b4 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 4 Jan 2018 13:49:41 +0000 Subject: [PATCH] fix #269 Former-commit-id: a0b8ed91061292e0f155cee9a7865609daacf836 [formerly e6bb9eaa82b5704f3fe29bdec50f6bb4f55304b2] [formerly b443cbf5c6d7946ff3cfa44493449b5f0d75d830 [formerly 02df1674341a6741a4724b07dc48ade3e65b28dd]] Former-commit-id: c193caff6faaf78a16375960893be9e253869d3c [formerly 6c84d234c9e1db432027bc159dbeeb77e9c35031] Former-commit-id: a48c3851511472efc47bce07ee2509fdd8a44c4a --- assets/src/utils/auth.js | 4 ++-- package.json | 1 + rice-box.go.REMOVED.git-id | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 rice-box.go.REMOVED.git-id 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