@auth-kit/next
Version:
Next Js Plugin for React Auth Kit
25 lines (24 loc) • 540 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _navigation = require("next/navigation");
const NextPlugin = {
navigate: function ({
to
}) {
(0, _navigation.redirect)(to);
},
useNavigate: function () {
const router = (0, _navigation.useRouter)();
return ({
to
}) => router.push(to);
},
usePath: function () {
const pathname = (0, _navigation.usePathname)();
return () => pathname;
}
};
var _default = exports.default = NextPlugin;