Skip to content

Commit

Permalink
fix redis guide
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 14, 2024
1 parent c32d091 commit 5894055
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pages/sessions/basic-api/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ Sessions are validated in 2 steps:

We'll also extend the session expiration when it's close to expiration. This ensures active sessions are persisted, while inactive ones will eventually expire. We'll handle this by checking if there's less than 15 days (half of the 30 day expiration) before expiration.

For convenience, we'll return both the session and user object tied to the session ID.

```ts
import { redis } from "./redis.js";
import { encodeBase32LowerCaseNoPadding, encodeHexLowerCase } from "@oslojs/encoding";
Expand Down Expand Up @@ -252,7 +250,7 @@ import { validateSessionToken } from "./session.js";

const token = cookies.get("session");
if (token !== null) {
const { session, user } = validateSessionToken(token);
const session = validateSessionToken(token);
}
```

Expand Down

0 comments on commit 5894055

Please sign in to comment.