feat: トークン手動発行機能

This commit is contained in:
syuilo
2020-07-18 12:12:10 +09:00
parent 0a4499fd03
commit 0c1de7b1b6
7 changed files with 117 additions and 6 deletions

View File

@ -13,7 +13,7 @@ export const meta = {
params: {
session: {
validator: $.str
validator: $.nullable.str
},
name: {
@ -52,4 +52,8 @@ export default define(meta, async (ps, user) => {
iconUrl: ps.iconUrl,
permission: ps.permission,
});
return {
token: accessToken
};
});

View File

@ -78,7 +78,7 @@ router.post('/miauth/:session/check', async ctx => {
session: ctx.params.session
});
if (token && !token.fetched) {
if (token && token.session != null && !token.fetched) {
AccessTokens.update(token.id, {
fetched: true
});

View File

@ -1,28 +0,0 @@
export const kinds = [
'read:account',
'write:account',
'read:blocks',
'write:blocks',
'read:drive',
'write:drive',
'read:favorites',
'write:favorites',
'read:following',
'write:following',
'read:messaging',
'write:messaging',
'read:mutes',
'write:mutes',
'write:notes',
'read:notifications',
'write:notifications',
'read:reactions',
'write:reactions',
'write:votes',
'read:pages',
'write:pages',
'write:page-likes',
'read:page-likes',
'read:user-groups',
'write:user-groups',
];

View File

@ -1,6 +1,6 @@
import endpoints from '../endpoints';
import * as locale from '../../../../locales/';
import { kinds as kindsList } from '../kinds';
import { kinds as kindsList } from '../../../misc/api-permissions';
export interface IKindInfo {
endpoints: string[];