Skip to content

Commit

Permalink
fix: add workaround for telegram id
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerilym committed Jul 4, 2024
1 parent c1809fe commit 616d5f9
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/auth/providers/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ export const TelegramProvider = ({ botToken }: TelegramProviderOptions) =>
});

export function handleTelegramSession({ session, token }: { session: Session; token: JWT }) {
console.log('token', token);
console.log('session', session);
if (token) {
console.log(token);
if (token?.picture?.includes('telegram')) {
if (token.sub) {
if (!token?.picture?.includes('discord')) {
// @ts-expect-error -- Next auth doesnt properly return the user id, this fixes that
session.user.telegramId = token.sub;
}
Expand Down

0 comments on commit 616d5f9

Please sign in to comment.