mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-09 04:23:08 +02:00
24 lines
427 B
TypeScript
24 lines
427 B
TypeScript
/**
|
|
* Module dependencies
|
|
*/
|
|
import User, { pack } from '../../../models/user';
|
|
|
|
/**
|
|
* Show myself
|
|
*/
|
|
module.exports = (params, user, app) => new Promise(async (res, rej) => {
|
|
const isSecure = user != null && app == null;
|
|
|
|
// Serialize
|
|
res(await pack(user, user, {
|
|
detail: true,
|
|
includeSecrets: isSecure
|
|
}));
|
|
|
|
// Update lastUsedAt
|
|
User.update({ _id: user._id }, {
|
|
$set: {
|
|
lastUsedAt: new Date()
|
|
}
|
|
});
|
|
});
|