mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 12:43:08 +02:00
30 lines
663 B
TypeScript
30 lines
663 B
TypeScript
import define from '../define';
|
|
import { Users } from '../../../models';
|
|
|
|
export const meta = {
|
|
desc: {
|
|
'ja-JP': '自分のアカウント情報を取得します。'
|
|
},
|
|
|
|
tags: ['account'],
|
|
|
|
requireCredential: true as const,
|
|
|
|
params: {},
|
|
|
|
res: {
|
|
type: 'object' as const,
|
|
optional: false as const, nullable: false as const,
|
|
ref: 'User',
|
|
},
|
|
};
|
|
|
|
export default define(meta, async (ps, user, token) => {
|
|
const isSecure = token == null;
|
|
|
|
// ここで渡ってきている user はキャッシュされていて古い可能性もあるので id だけ渡す
|
|
return await Users.pack(user.id, user, {
|
|
detail: true,
|
|
includeSecrets: isSecure
|
|
});
|
|
});
|