feat: user avatars from plex (#53)

This commit is contained in:
sct
2020-09-06 19:30:16 +09:00
committed by GitHub
parent 190a8831c7
commit e6349c13a0
6 changed files with 19 additions and 6 deletions

View File

@@ -46,6 +46,9 @@ authRoutes.post('/login', async (req, res) => {
user.plexToken = body.authToken;
await userRepository.save(user);
}
// Update the users avatar with their plex thumbnail (incase it changed)
user.avatar = account.thumb;
} else {
// Here we check if it's the first user. If it is, we create the user with no check
// and give them admin permissions
@@ -56,6 +59,7 @@ authRoutes.post('/login', async (req, res) => {
email: account.email,
plexToken: account.authToken,
permissions: Permission.ADMIN,
avatar: account.thumb,
});
await userRepository.save(user);
}