logout
This commit is contained in:
parent
86911bec9e
commit
1c1d0789cc
|
@ -12,12 +12,12 @@
|
||||||
"@ory/kratos-client": "^0.5.4-alpha.1",
|
"@ory/kratos-client": "^0.5.4-alpha.1",
|
||||||
"@tailwindcss/forms": "^0.2.1",
|
"@tailwindcss/forms": "^0.2.1",
|
||||||
"autoprefixer": "^10.2.4",
|
"autoprefixer": "^10.2.4",
|
||||||
"axios": "^0.21.1",
|
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"dayjs": "^1.10.4",
|
"dayjs": "^1.10.4",
|
||||||
"express-jwt": "^6.0.0",
|
"express-jwt": "^6.0.0",
|
||||||
"formik": "^2.2.6",
|
"formik": "^2.2.6",
|
||||||
"jwks-rsa": "^1.12.2",
|
"jwks-rsa": "^1.12.2",
|
||||||
|
"ky": "0.25.1",
|
||||||
"next": "^10.0.6",
|
"next": "^10.0.6",
|
||||||
"postcss": "^8.2.4",
|
"postcss": "^8.2.4",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import Head from "next/head";
|
import Head from "next/head";
|
||||||
import axios from "axios";
|
import ky from "ky/umd";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import config from "../../src/config";
|
import config from "../../src/config";
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ export default function Layout({ title, children }) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await axios.post("/logout");
|
await ky.post("/logout");
|
||||||
|
|
||||||
window.location = `${config.kratos.browser}/self-service/browser/flows/logout`;
|
window.location = `${config.kratos.browser}/self-service/browser/flows/logout`;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Reference in New Issue