Next.js Discord

Discord Forum

Login Redirect

Unanswered
Palomino posted this in #help-forum
Open in Discord
PalominoOP
Hello,

I am attempting to make a next.js website with Roblox authentication my concept is that I have a loginRedirect page and a callback url, how would I do this with SSR?

import { getBaseUrl } from "~/utils/trpc";

export default function LoginRedirect() {
    return <> </>;
}

export async function getServerSideProps() {
    return {
        redirect: {
            permanent: false,
            destination: `https://authorize.roblox.com/?client_id=${process.env.DISCORD_CLIENT_ID}&response_type=Code&redirect_uri=${getBaseUrl()}/auth/roblox&scope=openid+profile&step=landing`,
        },
    };
}


this works but isnt the best way to use openid, how would you guys do it?

0 Replies