Skip to content

Commit

Permalink
add authrequest ref
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Nov 30, 2023
1 parent a3175b2 commit cb018ba
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
type: "method"
---

Deletes the session cookie by setting a cookie that expires immediately.

## Definition

```ts
function deleteSessionCookie(): void;
```
29 changes: 29 additions & 0 deletions documentation-v3/src/reference/main/AuthRequest/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
type: "class"
---

The core API.

## Constructor

```ts
//$ Lucia=ref:main
//$ SessionCookie=ref:main
//$ RequestContext=ref:main
function constructor<_Lucia extends $$Lucia = Lucia>(
lucia: _Lucia,
requestContext: $$RequestContext
): this;
```

### Parameters

- `lucia`
- `sessionCookie`

## Method

- [`deleteSessionCookie()`](ref:main/AuthRequest)
- [`setSessionCookie()`](ref:main/AuthRequest)
- [`validate()`](ref:main/AuthRequest)
- [`validateBearerToken()`](ref:main/AuthRequest)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
type: "method"
---

Sets a session cookie for the provided session.

## Definition

```ts
function setSessionCookie(): void
```

### Parameters

- `userId`
- `attributes`: Database session attributes
11 changes: 11 additions & 0 deletions documentation-v3/src/reference/main/AuthRequest/validate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
type: "method"
---

Validates the session cookie. --TODO---

## Definition

```ts
function validate(): Promise<{ user: User; session: Session } | { user: null; session: null }>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
type: "method"
---

Validates the bearer token in the `Authorization` header. --TODO---

## Definition

```ts
function validateBearerToken(): Promise<
{ user: User; session: Session } | { user: null; session: null }
>;
```

0 comments on commit cb018ba

Please sign in to comment.