summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-08 22:43:46 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-08 22:43:46 +0900
commit2b1cbcc8bfe98f31721fd1ae0808982dafdec352 (patch)
treeef0fc57252ec39b1aab2e07d13841e77729936d7
parentMerge pull request #123 from syuilo/greenkeeper/riot-3.2.0 (diff)
downloadmisskey-2b1cbcc8bfe98f31721fd1ae0808982dafdec352.tar.gz
misskey-2b1cbcc8bfe98f31721fd1ae0808982dafdec352.tar.bz2
misskey-2b1cbcc8bfe98f31721fd1ae0808982dafdec352.zip
SHA256にした
-rw-r--r--docs/api/getting-started.pug2
-rw-r--r--src/api/endpoints/auth/accept.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/api/getting-started.pug b/docs/api/getting-started.pug
index e255a5e935..27a0c3a460 100644
--- a/docs/api/getting-started.pug
+++ b/docs/api/getting-started.pug
@@ -71,6 +71,6 @@ block content
br
| 上手くいけば、認証したユーザーのアクセストークンがレスポンスとして取得できます。おめでとうございます!
p
- | 以降アクセストークンは、<strong>ユーザーのアクセストークン+アプリのシークレットキーをsha512したもの</strong>として扱います。
+ | 以降アクセストークンは、<strong>ユーザーのアクセストークン+アプリのシークレットキーをsha256したもの</strong>として扱います。
p アクセストークンを取得できたら、あとは簡単です。REST APIなら、リクエストにアクセストークンを<code>i</code>としてパラメータに含めるだけです。
diff --git a/src/api/endpoints/auth/accept.js b/src/api/endpoints/auth/accept.js
index 90e6614514..04927ae50e 100644
--- a/src/api/endpoints/auth/accept.js
+++ b/src/api/endpoints/auth/accept.js
@@ -72,9 +72,9 @@ module.exports = (params, user) =>
});
// Generate Hash
- const sha512 = crypto.createHash('sha512');
- sha512.update(token + app.secret);
- const hash = sha512.digest('hex');
+ const sha256 = crypto.createHash('sha256');
+ sha256.update(token + app.secret);
+ const hash = sha256.digest('hex');
// Insert access token doc
await AccessToken.insert({