white-article-28775
06/15/2022, 11:51 AM<https://auth-dev.wand.ai>
), but our NextJS app is deployed via Vercel (<http://wand.vercel.app|wand.vercel.app>
) and I can't figure out how to make this connection work.
I say presumably, because it was actually set up by some external person so not in my control and I don't know what's in there.
That's the first issue in theory, in practice my main issue is that I don't actually understand how to set up my connection code-wise. I installed the @ory/client
and @ory/integration
packages and also basically copied the api/sdk/login implementation from the NextJS app example on GitHub (swapping the URL for the correct one of course), but all I get is a 404 error from the path <http://localhost:3000/api/.ory/self-service/login/browser?refresh=false>
.
The two issues might be connected, but I am so lost 😞steep-lamp-91158
white-article-28775
06/15/2022, 1:28 PM.ory
in the url because that's the directory name, as shown in your NextJS example on Github.white-article-28775
06/15/2022, 1:29 PMORY_SDK_URL=<https://auth-dev.wand.ai>
high-optician-2097
<http://localhost:3000/api/.ory/self-service/login/browser?refresh=false>
white-article-28775
06/15/2022, 1:30 PMhigh-optician-2097
white-article-28775
06/15/2022, 1:32 PMhigh-optician-2097
white-article-28775
06/15/2022, 1:35 PMhigh-optician-2097
white-article-28775
06/15/2022, 1:35 PM<!DOCTYPE html><html><head><style data-next-hide-fouc="true">body{display:none}</style><noscript data-next-hide-fouc="true"><style>body{display:block}</style></noscript><meta name="viewport" content="width=device-width"/><meta charSet="utf-8"/><title>404: This page could not be found</title><meta name="next-head-count" content="3"/><noscript data-n-css=""></noscript><script defer="" nomodule="" src="/_next/static/chunks/polyfills.js?ts=1655300048236"></script><script src="/_next/static/chunks/webpack.js?ts=1655300048236" defer=""></script><script src="/_next/static/chunks/main.js?ts=1655300048236" defer=""></script><script src="/_next/static/chunks/pages/_app.js?ts=1655300048236" defer=""></script><script src="/_next/static/chunks/pages/_error.js?ts=1655300048236" defer=""></script><script src="/_next/static/development/_buildManifest.js?ts=1655300048236" defer=""></script><script src="/_next/static/development/_ssgManifest.js?ts=1655300048236" defer=""></script><script src="/_next/static/development/_middlewareManifest.js?ts=1655300048236" defer=""></script><noscript id="__next_css__DO_NOT_USE__"></noscript></head><body><div id="__next"><div class="w-screen h-screen flex"><div class="h-100 flex flex-col gap-4 p-4"><a class="hover:outline-none hover:ring-1 focus:outline-none focus:ring-1 bg-white border-1 rounded-lg flex justify-center items-center px-1 3xssm:px-2 sm:px-3 py-2 hover:border-pink-500 hover:ring-pink-500 focus:border-pink-500 focus:ring-pink-500" href="/"> <!-- --><span class="font-urbanist font-medium text-xs">Home</span></a><a class="hover:outline-none hover:ring-1 focus:outline-none focus:ring-1 bg-white border-1 rounded-lg flex justify-center items-center px-1 3xssm:px-2 sm:px-3 py-2 hover:border-pink-500 hover:ring-pink-500 focus:border-pink-500 focus:ring-pink-500" href="/grid"> <!-- --><span class="font-urbanist font-medium text-xs">Grid</span></a><a class="hover:outline-none hover:ring-1 focus:outline-none focus:ring-1 bg-white border-1 rounded-lg flex justify-center items-center px-1 3xssm:px-2 sm:px-3 py-2 hover:border-pink-500 hover:ring-pink-500 focus:border-pink-500 focus:ring-pink-500" href="/deployment"> <!-- --><span class="font-urbanist font-medium text-xs">Deployment</span></a><a class="hover:outline-none hover:ring-1 focus:outline-none focus:ring-1 bg-white border-1 rounded-lg flex justify-center items-center px-1 3xssm:px-2 sm:px-3 py-2 hover:border-pink-500 hover:ring-pink-500 focus:border-pink-500 focus:ring-pink-500" href="/wizard/1"> <!-- --><span class="font-urbanist font-medium text-xs">Wizard 1</span></a><a class="hover:outline-none hover:ring-1 focus:outline-none focus:ring-1 bg-white border-1 rounded-lg flex justify-center items-center px-1 3xssm:px-2 sm:px-3 py-2 hover:border-pink-500 hover:ring-pink-500 focus:border-pink-500 focus:ring-pink-500" href="/login"> <!-- --><span class="font-urbanist font-medium text-xs">Login</span></a></div><div class="flex-grow"><div style="font-family:-apple-system, BlinkMacSystemFont, Roboto, "Segoe UI", "Fira Sans", Avenir, "Helvetica Neue", "Lucida Grande", sans-serif;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>
body { margin: 0; color: #000; background: #fff; }
.next-error-h1 {
border-right: 1px solid rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
body { color: #fff; background: #000; }
.next-error-h1 {
border-right: 1px solid rgba(255, 255, 255, .3);
}
}</style><h1 class="next-error-h1" style="display:inline-block;margin:0;margin-right:20px;padding:10px 23px 10px 0;font-size:24px;font-weight:500;vertical-align:top">404<!-- --></h1><div style="display:inline-block;text-align:left;line-height:49px;height:49px;vertical-align:middle"><h2 style="font-size:14px;font-weight:normal;line-height:inherit;margin:0;padding:0">This page could not be found<!-- -->.<!-- --></h2></div></div></div></div></div></div><script src="/next/static/chunks/react-refresh.js?ts=1655300048236"></script><script id="_NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404,"hasGetInitialPropsRun":true}},"page":"/_error","query":{"refresh":"false"},"buildId":"development","isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
high-optician-2097
high-optician-2097
high-optician-2097
white-article-28775
06/15/2022, 1:38 PMhigh-optician-2097
white-article-28775
06/15/2022, 1:46 PMhigh-optician-2097
high-optician-2097
white-article-28775
06/15/2022, 1:48 PMhigh-optician-2097
white-article-28775
06/15/2022, 1:53 PM/api/x/
)
I put it entirely into .ory
and it still works (/api/.ory/x
)white-article-28775
06/15/2022, 1:54 PMhigh-optician-2097
white-article-28775
06/16/2022, 7:30 AMhigh-optician-2097
white-article-28775
06/16/2022, 1:15 PMwhite-article-28775
06/16/2022, 1:16 PM<https://auth-dev.wand.ai/self-service/login/browser>
returns a redirect, but the the subsequent /login?flow=...
returns 404high-optician-2097
high-optician-2097
white-article-28775
06/16/2022, 1:17 PMwhite-article-28775
06/16/2022, 1:17 PMwhite-article-28775
06/16/2022, 1:18 PM/self-service/login/browser
both from a browser and from Postman both return 404swhite-article-28775
06/16/2022, 1:18 PM/login?flow=...