Next-auth Discord and get profile with useSession()
Unanswered
Southern rough shrimp posted this in #help-forum
Southern rough shrimpOP
Hi everyone, I created an app to authenticate with Discord. But when user is authenticated, I would like to get the discriminator to redirect it to its profile page but I only have this information in profile, not in session:
export default function LoginPage(){
const {data:session} = useSession();
const router = useRouter()
console.log("session:",session);
if(!session){
return (
<div>
<button className="bg-blue-800" onClick={ ()=> signIn("discord")}>Sign In with Discord</button>
</div>
)
}
else{
// I don't have the discriminator
router.push(`/users/profile/BriceHarper#9530`)
}
}6 Replies
This question was asked yesterday
You can find more details there
@linesofcode This question was asked yesterday
Southern rough shrimpOP
I can't access to the channel
No access@Southern rough shrimp I can't access to the channel `No access`
get the typescript role in <id:customize>
Southern rough shrimpOP
thanks you both