Help needed in Linear redirection

baseURL: 'http://localhost:3000/api/v1/auth', const authPrefix = '/api/v1/auth'; app.use((req: Request, res: Response, next: NextFunction) => { if (!req.url.startsWith(authPrefix)) return next(); const handler = toNodeHandler(auth); return handler(req, res); }); export const authClient = createAuthClient({ baseURL: ${process.env.NEXT_PUBLIC_SERVER_URL ?? 'http://localhost:3000'}/api/v1/auth, socialProviders: { linear: { clientId: "xxx", clientSecret: "xxx", scope: ["read", "write", "issues:create"], redirectURI: "http://localhost:3000/api/v1/auth/linear/callback", }, }, in linear portal: Redirect URIs http://localhost:3000/api/v1/auth/linear/callback when I sign in it says This localhost page can’t be found No webpage was found for the web address: http://localhost:3000/api/v1/auth/linear/callback?code=fvbvbv&state=effef HTTP ERROR 404
9 Replies
Vishal Anton
Vishal AntonOP7d ago
But linear's access token is stored in Account table, Now I wanna how it will come back to my web app
Vishal Anton
Vishal AntonOP7d ago
Even I tried this const data = await authClient.signIn.social({ provider: "linear", callbackURL: "http://localhost:3001/dashboard", newUserCallbackURL: "http://localhost:3001/dashboard", })
No description
The Untraceable
Yeah that's the wrong format for the redirect I'm pretty sure It's http://localhost:3000/api/v1/auth/callback/linear or somethin lemme go double check
Vishal Anton
Vishal AntonOP7d ago
Yeah I have updated the baseURL
The Untraceable
No like look at the paths You're doing linear/callback It's /callback/linear Hence the 404
Vishal Anton
Vishal AntonOP7d ago
Oh my god
The Untraceable
yea lol one of the quirks with better auth i rather prefer /provider/callback as supposed to /callback/provider But eh you set it once and forget it Try it out and lmk
Vishal Anton
Vishal AntonOP7d ago
Now it worked, been debugging for the past 5 hours, I was in a thought since I updated the baseURL something messed up Thanks for helping bro!
The Untraceable
All good 👍

Did you find this page helpful?