[PLUGIN][Pinboard] Change token to user user ID rather than nickname, to avoid complications with it possibly changing

This commit is contained in:
2022-03-31 22:06:37 +01:00
parent 94ab4ce8c4
commit 1664293cf7
4 changed files with 15 additions and 32 deletions

View File

@@ -79,8 +79,8 @@ class APIv1 extends Controller
if (!str_contains($input, ':')) {
return null;
}
[$nickame, $token] = explode(':', $input);
return Token::get($nickame, $token)?->getUser();
[$id, $token] = explode(':', $input);
return Token::get($id, $token)?->getUser();
}
private function deleteNoteAndMaybePin(LocalUser $user, Note $note, ?Pin $pin): void