add console.log to debug login issues
This commit is contained in:
parent
3310273968
commit
103009e43f
|
@ -10,6 +10,8 @@ export default async (req, res) => {
|
||||||
res.setHeader("Set-Cookie", header["set-cookie"]);
|
res.setHeader("Set-Cookie", header["set-cookie"]);
|
||||||
res.redirect(req.query.return_to ?? "/");
|
res.redirect(req.query.return_to ?? "/");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(`Cookie is present but authentication failed: ${error.message}`);
|
||||||
|
|
||||||
// credentials were correct but accounts service failed
|
// credentials were correct but accounts service failed
|
||||||
res.redirect("/.ory/kratos/public/self-service/browser/flows/logout");
|
res.redirect("/.ory/kratos/public/self-service/browser/flows/logout");
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ export async function getServerSideProps(context) {
|
||||||
|
|
||||||
throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
|
throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error.message); // log failure message for debugging purpose
|
console.log(`Unexpected error retrieving login flow: ${error.message}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
|
|
|
@ -35,6 +35,8 @@ export async function getServerSideProps(context) {
|
||||||
|
|
||||||
throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
|
throw new Error(`Failed to retrieve flow ${flow} with code ${status}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log(`Unexpected error retrieving registration flow: ${error.message}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
redirect: {
|
redirect: {
|
||||||
permanent: false,
|
permanent: false,
|
||||||
|
|
Reference in New Issue