“Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS” Kode Jawaban

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS

 componentDidMount() { // and/or componentDidUpdate, depending on what you're trying to do
      if (!auth) {
         Router.push({
               pathname: '/login',
               query: { from: {router.pathname} },
         }))
     }
   }

//Then on the login page, after successful login:
    handlePostLoginOk = () => {
          const { router } = this.props;
          if (router.query && router.query.from) {
               router.push(router.query.from);
        }
  }
Zakariyau Abdullahi

Jawaban yang mirip dengan “Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS”

Pertanyaan yang mirip dengan “Cara Kembali ke Rute Sebelumnya Setelah Otentikasi di NextJS”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya