Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-guard-history-router

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-guard-history-router - npm Package Compare versions

Comparing version 2.22.0 to 2.23.0

2

package.json
{
"name": "svelte-guard-history-router",
"version": "2.22.0",
"version": "2.23.0",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

@@ -31,13 +31,7 @@ [![Svelte v3](https://img.shields.io/badge/svelte-v3-orange.svg)](https://svelte.dev)

```js
import { Guard } from 'svelte-guard-history-router';
import { redirectGuard } from 'svelte-guard-history-router';
let session = undefined;
class SessionGuard extends Guard {
async enter(transition) {
if(!session) {
return transition.redirect('/login');
}
}
}
export const enshureSession = redirectGuard("/login", () => !session);
```

@@ -54,3 +48,3 @@

import { sessionGuard } from "./main.mjs";
import { enshureSession } from "./main.mjs";
</script>

@@ -67,3 +61,3 @@

<li>
<Route path="/article" guards={sessionGuard} component={Articles}>
<Route path="/article" guards={enshureSession} component={Articles}>
Articles

@@ -74,3 +68,3 @@ <Route path="/:artice" component={Article}/>

<li>
<Route path="/category" guards={sessionGuard} component={Categories}>
<Route path="/category" guards={enshureSession} component={Categories}>
Categories

@@ -77,0 +71,0 @@ <Route path="/:category" component={Category}/>

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc