Skip to content

Modify Session Object Value ? #2226

Discussion options

You must be logged in to vote

Hi @sushilbalami,

I struggled a lot with this one too, trying to retrieve the screen_name for a Twitter authentication.

Here's my [...nextauth].ts file, when I finally got it working:

import NextAuth from "next-auth";
import { signin } from "next-auth/client";
import Providers from "next-auth/providers";

export default NextAuth({
  providers: [
    Providers.Twitter({
      clientId: process.env.TWITTER_KEY,
      clientSecret: process.env.TWITTER_SECRET,
      profile(profile) {
        return {
          id: profile.id_str as string,
          name: profile.name,
          email: profile.email,
          image: (profile.profile_image_url_https as string).replace(
            /_normal\.…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@balazsorban44
Comment options

@rchampourlier
Comment options

@sushilbalami
Comment options

@balazsorban44
Comment options

@rchampourlier
Comment options

Answer selected by sushilbalami
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
3 participants
Converted from issue

This discussion was converted from issue #2225 on June 21, 2021 08:07.