mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-29 07:18:08 +09:00
Fix bug
This commit is contained in:
parent
10ab391b71
commit
15ea610f95
@ -12,6 +12,7 @@ const User = db.get<IUser>('users');
|
||||
|
||||
User.createIndex('username');
|
||||
User.createIndex('token');
|
||||
User.createIndex('uri', { sparse: true, unique: true });
|
||||
|
||||
export default User;
|
||||
|
||||
|
@ -12,6 +12,14 @@ export default async (value: string | IObject, verifier?: string): Promise<IUser
|
||||
|
||||
if (id.startsWith(config.url + '/')) {
|
||||
return await User.findOne({ _id: id.split('/').pop() });
|
||||
} else {
|
||||
const exist = await User.findOne({
|
||||
uri: id
|
||||
});
|
||||
|
||||
if (exist) {
|
||||
return exist;
|
||||
}
|
||||
}
|
||||
|
||||
const resolver = new Resolver();
|
||||
|
Loading…
Reference in New Issue
Block a user