# next-blitz-auth

## 0.1.15

### Patch Changes

- Updated dependencies [0b3286468]
- Updated dependencies [50f17d21c]
  - @blitzjs/auth@2.1.3
  - @blitzjs/next@2.1.3
  - @blitzjs/rpc@2.1.3
  - blitz@2.1.3
  - @blitzjs/config@2.1.3

## 0.1.14

### Patch Changes

- blitz@2.1.2
- @blitzjs/auth@2.1.2
- @blitzjs/next@2.1.2
- @blitzjs/rpc@2.1.2
- @blitzjs/config@2.1.2

## 0.1.13

### Patch Changes

- Updated dependencies [9a0ba87d1]
  - @blitzjs/rpc@2.1.1
  - blitz@2.1.1
  - @blitzjs/next@2.1.1
  - @blitzjs/auth@2.1.1
  - @blitzjs/config@2.1.1

## 0.1.12

### Patch Changes

- Updated dependencies [d53da39cb]
- Updated dependencies [3b10b13e6]
  - blitz@2.1.0
  - @blitzjs/auth@2.1.0
  - @blitzjs/next@2.1.0
  - @blitzjs/rpc@2.1.0
  - @blitzjs/config@2.1.0

## 0.1.11

### Patch Changes

- Updated dependencies [318e9740d]
  - @blitzjs/auth@2.0.10
  - blitz@2.0.10
  - @blitzjs/rpc@2.0.10
  - @blitzjs/next@2.0.10
  - @blitzjs/config@2.0.10

## 0.1.10

### Patch Changes

- Updated dependencies [5a14306f7]
  - @blitzjs/next@2.0.9
  - @blitzjs/rpc@2.0.9
  - blitz@2.0.9
  - @blitzjs/auth@2.0.9
  - @blitzjs/config@2.0.9

## 0.1.9

### Patch Changes

- Updated dependencies [5e61a1681]
- Updated dependencies [77555468f]
  - @blitzjs/next@2.0.8
  - blitz@2.0.8
  - @blitzjs/auth@2.0.8
  - @blitzjs/rpc@2.0.8
  - @blitzjs/config@2.0.8

## 0.1.8

### Patch Changes

- Updated dependencies [ee7bf87ec]
- Updated dependencies [178c152b2]
  - blitz@2.0.7
  - @blitzjs/next@2.0.7
  - @blitzjs/rpc@2.0.7
  - @blitzjs/auth@2.0.7
  - @blitzjs/config@2.0.7

## 0.1.7

### Patch Changes

- Updated dependencies [76a2544f9]
- Updated dependencies [5a587a6c3]
  - blitz@2.0.6
  - @blitzjs/auth@2.0.6
  - @blitzjs/next@2.0.6
  - @blitzjs/rpc@2.0.6
  - @blitzjs/config@2.0.6

## 0.1.6

### Patch Changes

- Updated dependencies [6f54841b7]
- Updated dependencies [8a417533f]
  - @blitzjs/auth@2.0.5
  - blitz@2.0.5
  - @blitzjs/rpc@2.0.5
  - @blitzjs/next@2.0.5
  - @blitzjs/config@2.0.5

## 0.1.5

### Patch Changes

- Updated dependencies [dd604c767]
- Updated dependencies [28a79040e]
  - @blitzjs/auth@2.0.4
  - blitz@2.0.4
  - @blitzjs/next@2.0.4
  - @blitzjs/rpc@2.0.4
  - @blitzjs/config@2.0.4

## 0.1.4

### Patch Changes

- Updated dependencies [2f5c8a3a0]
  - @blitzjs/next@2.0.3
  - @blitzjs/rpc@2.0.3
  - blitz@2.0.3
  - @blitzjs/auth@2.0.3
  - @blitzjs/config@2.0.3

## 0.1.3

### Patch Changes

- Updated dependencies [e8fd12e4f]
  - @blitzjs/rpc@2.0.2
  - blitz@2.0.2
  - @blitzjs/next@2.0.2
  - @blitzjs/auth@2.0.2
  - @blitzjs/config@2.0.2

## 0.1.2

### Patch Changes

- Updated dependencies [8782aae64]
  - blitz@2.0.1
  - @blitzjs/auth@2.0.1
  - @blitzjs/next@2.0.1
  - @blitzjs/rpc@2.0.1
  - @blitzjs/config@2.0.1

## 0.1.1

### Patch Changes

- Updated dependencies [db7233db6]
- Updated dependencies [1569bd53e]
- Updated dependencies [cee2dec17]
- Updated dependencies [c5c727cb6]
- Updated dependencies [5166e5e03]
- Updated dependencies [72a4e594a]
- Updated dependencies [9db6c8855]
- Updated dependencies [1e1bb73b2]
- Updated dependencies [83b355900]
- Updated dependencies [4cad9cca2]
- Updated dependencies [c1e004063]
- Updated dependencies [365e67094]
- Updated dependencies [fd31e56bc]
- Updated dependencies [74a14b704]
- Updated dependencies [eda14fa8a]
- Updated dependencies [aec1bb076]
- Updated dependencies [a3c92cb86]
- Updated dependencies [270361886]
- Updated dependencies [c721c104d]
- Updated dependencies [82649f341]
- Updated dependencies [072929109]
- Updated dependencies [f397cc203]
- Updated dependencies [cadefb88e]
- Updated dependencies [271c58ac6]
- Updated dependencies [8f166a5db]
- Updated dependencies [8c247e26e]
- Updated dependencies [c5572bec6]
- Updated dependencies [69fb28034]
- Updated dependencies [86e8eb7c8]
- Updated dependencies [99205f52d]
- Updated dependencies [3f20a4740]
- Updated dependencies [82e8b64f5]
- Updated dependencies [6ece09613]
- Updated dependencies [9c2e7d372]
- Updated dependencies [928e840b5]
- Updated dependencies [9631c4583]
- Updated dependencies [6f18cbdc9]
- Updated dependencies [acc07ce94]
- Updated dependencies [ea7561b8e]
- Updated dependencies [1436e7618]
- Updated dependencies [2533caf48]
- Updated dependencies [696f48c4e]
- Updated dependencies [d98e4bac4]
- Updated dependencies [90f1741da]
- Updated dependencies [4a9aa9f7f]
- Updated dependencies [d692b4c1d]
- Updated dependencies [638f2319b]
- Updated dependencies [c213d521c]
- Updated dependencies [7817fe3a8]
- Updated dependencies [0e762fb55]
- Updated dependencies [9529dbd6f]
- Updated dependencies [3b213a35b]
- Updated dependencies [8b01175b4]
- Updated dependencies [3d004dc41]
- Updated dependencies [5ea068b28]
- Updated dependencies [1d863f352]
- Updated dependencies [8b4bf999c]
- Updated dependencies [1476a577b]
- Updated dependencies [a6e81f156]
- Updated dependencies [cacb65d63]
- Updated dependencies [ae0b714f6]
- Updated dependencies [c7ac86b85]
- Updated dependencies [d9fc5d8e2]
- Updated dependencies [ccb1af8d0]
- Updated dependencies [630c71812]
- Updated dependencies [bf1b2c824]
- Updated dependencies [240f3f347]
- Updated dependencies [55b1cb204]
- Updated dependencies [1742eb45d]
- Updated dependencies [54db8a46d]
- Updated dependencies [962eb58af]
- Updated dependencies [54a66a95d]
- Updated dependencies [9fe0cc546]
- Updated dependencies [55a43ce1f]
- Updated dependencies [0b94a4503]
- Updated dependencies [af58e2b23]
- Updated dependencies [78fd5c489]
- Updated dependencies [62bf12b5c]
- Updated dependencies [6ff9ec0d7]
- Updated dependencies [09e0c68db]
- Updated dependencies [abb1ad5d1]
- Updated dependencies [3a602b613]
- Updated dependencies [ceb7db274]
- Updated dependencies [2ade7268e]
- Updated dependencies [0edeaa37a]
- Updated dependencies [7b63f0f1f]
- Updated dependencies [03bad3175]
- Updated dependencies [f0ca738d5]
- Updated dependencies [bee19a259]
- Updated dependencies [0936cb38a]
- Updated dependencies [c11f0401c]
- Updated dependencies [989691ec8]
- Updated dependencies [4d7d126d9]
- Updated dependencies [8e5903c0f]
- Updated dependencies [30fd61316]
- Updated dependencies [6f4349896]
- Updated dependencies [942536d9a]
- Updated dependencies [666a3ae3e]
- Updated dependencies [a80d2a8f7]
- Updated dependencies [f6dac093d]
- Updated dependencies [3ddb57072]
- Updated dependencies [4e26ae21b]
- Updated dependencies [abe2afccd]
- Updated dependencies [da17cc8a2]
- Updated dependencies [b84c5bedb]
- Updated dependencies [a6f32d1d0]
- Updated dependencies [b97366c42]
- Updated dependencies [348fd6f5e]
- Updated dependencies [1bb3a6556]
- Updated dependencies [3bcbad1a9]
- Updated dependencies [0a8b0cb35]
- Updated dependencies [8490b0724]
- Updated dependencies [9ded8dacb]
- Updated dependencies [19898a488]
- Updated dependencies [93851d90c]
- Updated dependencies [f84d77a42]
- Updated dependencies [6811eab1a]
- Updated dependencies [a7e37c58d]
- Updated dependencies [20fc9f80f]
- Updated dependencies [8dedca1a2]
- Updated dependencies [3511d5b69]
- Updated dependencies [46a34c7b3]
- Updated dependencies [e82a79be5]
- Updated dependencies [890b0c0c9]
- Updated dependencies [11b548ede]
- Updated dependencies [ed2b0e22c]
- Updated dependencies [430f6ec78]
- Updated dependencies [df7cee84a]
- Updated dependencies [adabb11a0]
- Updated dependencies [38d945a3f]
- Updated dependencies [c3c789740]
- Updated dependencies [240f378b5]
- Updated dependencies [df3265b85]
- Updated dependencies [89bf993a1]
- Updated dependencies [2150dcc3e]
- Updated dependencies [0f4926fd1]
- Updated dependencies [3f9fe8f04]
- Updated dependencies [8aee25c58]
- Updated dependencies [fe8c937d2]
- Updated dependencies [0ac6e1712]
- Updated dependencies [c0a3b1ee3]
- Updated dependencies [5c5decbce]
- Updated dependencies [dc694cf1c]
- Updated dependencies [e5cd2c862]
- Updated dependencies [807a2b564]
- Updated dependencies [97469a126]
- Updated dependencies [931156c35]
- Updated dependencies [650a157e1]
- Updated dependencies [1d9804a61]
- Updated dependencies [41608c4c3]
- Updated dependencies [a0596279b]
- Updated dependencies [88caa18e6]
- Updated dependencies [022392c12]
- Updated dependencies [17ce29e5e]
- Updated dependencies [f52ca398e]
- Updated dependencies [c126b8191]
- Updated dependencies [c9cf7adc3]
- Updated dependencies [1b798d9a0]
- Updated dependencies [0f18c68d6]
- Updated dependencies [ea7561b8e]
- Updated dependencies [6ab9db780]
- Updated dependencies [727734955]
- Updated dependencies [80e1ead7c]
- Updated dependencies [f39ba1ff1]
- Updated dependencies [161270e3b]
- Updated dependencies [bec9512e3]
- Updated dependencies [b6b9a1c5a]
- Updated dependencies [1436e7618]
- Updated dependencies [1c809094f]
- Updated dependencies [145d5a02b]
- Updated dependencies [8bcb471a5]
- Updated dependencies [a3e6c49c4]
- Updated dependencies [490280240]
- Updated dependencies [15d22af24]
- Updated dependencies [454591293]
- Updated dependencies [6e88a847f]
- Updated dependencies [0025856b9]
- Updated dependencies [2073714f8]
- Updated dependencies [716e188d1]
- Updated dependencies [d87288a2e]
- Updated dependencies [8aa22a0b2]
- Updated dependencies [37aeaa7fa]
- Updated dependencies [b918055bf]
- Updated dependencies [aa34661fa]
- Updated dependencies [61888d1a3]
- Updated dependencies [dd5f51744]
- Updated dependencies [ce4536833]
- Updated dependencies [9ada0f666]
- Updated dependencies [fb32903bf]
- Updated dependencies [b33db0828]
- Updated dependencies [f15a51901]
- Updated dependencies [10f98c681]
- Updated dependencies [42a2cf951]
- Updated dependencies [9674efc0b]
- Updated dependencies [8e0c9d76b]
- Updated dependencies [9620ef6b1]
- Updated dependencies [d5b8faa86]
- Updated dependencies [a3bbe6ce3]
- Updated dependencies [b493c93f8]
- Updated dependencies [3b213a35b]
- Updated dependencies [8d9ea00e1]
- Updated dependencies [e2c18895d]
- Updated dependencies [00bd849ee]
- Updated dependencies [ffa7b5ccc]
- Updated dependencies [1f6b0b54c]
- Updated dependencies [527e48ac3]
- Updated dependencies [01f3a03ea]
- Updated dependencies [dfd2408e9]
- Updated dependencies [b0c21b070]
- Updated dependencies [25f4526f7]
- Updated dependencies [31d7a6f41]
- Updated dependencies [2cc888eff]
- Updated dependencies [29c2b029a]
- Updated dependencies [713aead93]
  - blitz@2.0.0
  - @blitzjs/auth@2.0.0
  - @blitzjs/next@2.0.0
  - @blitzjs/rpc@2.0.0
  - @blitzjs/config@2.0.0

## 0.1.1-beta.13

### Patch Changes

- Updated dependencies [86e8eb7c8]
- Updated dependencies [b84c5bedb]
- Updated dependencies [e5cd2c862]
  - @blitzjs/rpc@2.0.0-beta.37
  - blitz@2.0.0-beta.37
  - @blitzjs/auth@2.0.0-beta.37
  - @blitzjs/next@2.0.0-beta.37
  - @blitzjs/config@2.0.0-beta.37

## 0.1.1-beta.12

### Patch Changes

- Updated dependencies [09e0c68db]
  - @blitzjs/auth@2.0.0-beta.36
  - blitz@2.0.0-beta.36
  - @blitzjs/rpc@2.0.0-beta.36
  - @blitzjs/next@2.0.0-beta.36
  - @blitzjs/config@2.0.0-beta.36

## 0.1.1-beta.11

### Patch Changes

- Updated dependencies [cee2dec17]
- Updated dependencies [aec1bb076]
- Updated dependencies [b97366c42]
- Updated dependencies [3bcbad1a9]
  - @blitzjs/auth@2.0.0-beta.35
  - blitz@2.0.0-beta.35
  - @blitzjs/next@2.0.0-beta.35
  - @blitzjs/rpc@2.0.0-beta.35
  - @blitzjs/config@2.0.0-beta.35

## 0.1.1-beta.10

### Patch Changes

- Updated dependencies [30fd61316]
- Updated dependencies [3ddb57072]
- Updated dependencies [fe8c937d2]
  - blitz@2.0.0-beta.34
  - @blitzjs/auth@2.0.0-beta.34
  - @blitzjs/next@2.0.0-beta.34
  - @blitzjs/rpc@2.0.0-beta.34
  - @blitzjs/config@2.0.0-beta.34

## 0.1.1-beta.9

### Patch Changes

- Updated dependencies [19898a488]
- Updated dependencies [6811eab1a]
- Updated dependencies [022392c12]
  - @blitzjs/rpc@2.0.0-beta.33
  - blitz@2.0.0-beta.33
  - @blitzjs/next@2.0.0-beta.33
  - @blitzjs/auth@2.0.0-beta.33
  - @blitzjs/config@2.0.0-beta.33

## 0.1.1-beta.8

### Patch Changes

- Updated dependencies [82649f341]
- Updated dependencies [8b01175b4]
  - blitz@2.0.0-beta.32
  - @blitzjs/next@2.0.0-beta.32
  - @blitzjs/auth@2.0.0-beta.32
  - @blitzjs/rpc@2.0.0-beta.32
  - @blitzjs/config@2.0.0-beta.32

## 0.1.1-beta.7

### Patch Changes

- Updated dependencies [90f1741da]
- Updated dependencies [df3265b85]
  - @blitzjs/auth@2.0.0-beta.31
  - blitz@2.0.0-beta.31
  - @blitzjs/rpc@2.0.0-beta.31
  - @blitzjs/next@2.0.0-beta.31
  - @blitzjs/config@2.0.0-beta.31

## 0.1.1-beta.6

### Patch Changes

- Updated dependencies [c5572bec6]
- Updated dependencies [727734955]
  - @blitzjs/auth@2.0.0-beta.30
  - blitz@2.0.0-beta.30
  - @blitzjs/rpc@2.0.0-beta.30
  - @blitzjs/next@2.0.0-beta.30
  - @blitzjs/config@2.0.0-beta.30

## 0.1.1-beta.5

### Patch Changes

- Updated dependencies [b6b9a1c5a]
- Updated dependencies [61888d1a3]
  - @blitzjs/auth@2.0.0-beta.29
  - blitz@2.0.0-beta.29
  - @blitzjs/rpc@2.0.0-beta.29
  - @blitzjs/next@2.0.0-beta.29
  - @blitzjs/config@2.0.0-beta.29

## 0.1.1-beta.4

### Patch Changes

- Updated dependencies [5166e5e03]
- Updated dependencies [2533caf48]
- Updated dependencies [c7ac86b85]
- Updated dependencies [1bb3a6556]
  - @blitzjs/auth@2.0.0-beta.28
  - @blitzjs/next@2.0.0-beta.28
  - @blitzjs/rpc@2.0.0-beta.28
  - blitz@2.0.0-beta.28
  - @blitzjs/config@2.0.0-beta.28

## 0.1.1-beta.3

### Patch Changes

- Updated dependencies [eda14fa8a]
- Updated dependencies [3d004dc41]
- Updated dependencies [29c2b029a]
  - @blitzjs/next@2.0.0-beta.27
  - @blitzjs/rpc@2.0.0-beta.27
  - @blitzjs/auth@2.0.0-beta.27
  - blitz@2.0.0-beta.27
  - @blitzjs/config@2.0.0-beta.27

## 0.1.1-beta.2

### Patch Changes

- Updated dependencies [e82a79be5]
- Updated dependencies [38d945a3f]
  - @blitzjs/auth@2.0.0-beta.26
  - @blitzjs/next@2.0.0-beta.26
  - @blitzjs/rpc@2.0.0-beta.26
  - blitz@2.0.0-beta.26
  - @blitzjs/config@2.0.0-beta.26

## 0.1.1-beta.1

### Patch Changes

- Updated dependencies [f84d77a42]
  - @blitzjs/rpc@2.0.0-beta.25
  - @blitzjs/next@2.0.0-beta.25
  - @blitzjs/auth@2.0.0-beta.25
  - @blitzjs/config@2.0.0-beta.25
  - blitz@2.0.0-beta.25

## 0.1.1-beta.0

### Patch Changes

- 37aeaa7fa: feature: Nextjs 13 App Directory Utility Methods

  ### 🔧 New Blitz Auth Hook `useAuthenticatedBlitzContext`

  This hook is implemented as the replacement of the [`BlitzPage` seurity auth utilities](https://blitzjs.com/docs/authorization#secure-your-pages) provided for the pages directory to work with React Server Components in the Nextjs 13 app directory
  It can be used in any asynchronous server component be it in `page.ts` or in the layouts in `layout.ts`
  It uses the new [`redirect` function](https://beta.nextjs.org/docs/api-reference/redirect) to provide the required authorization in server side

  #### API

  ```ts
  useAuthenticatedBlitzContext({
    redirectTo,
    redirectAuthenticatedTo,
    role,
  }: {
    redirectTo?: string | RouteUrlObject
    redirectAuthenticatedTo?: string | RouteUrlObject | ((ctx: Ctx) => string | RouteUrlObject)
    role?: string | string[]
  }): Promise<void>
  ```

  #### Usage

  **Example Usage in React Server Component in `app` directory in Next 13**

  ```ts
  import {getAppSession, useAuthenticatedBlitzContext} from "src/blitz-server"
  ...
  await useAuthenticatedBlitzContext({
      redirectTo: "/auth/login",
      role: ["admin"],
      redirectAuthenticatedTo: "/dashboard",
  })
  ```

  ### 🔧 New Blitz RPC Hook `invokeResolver`

  #### API

  ```ts
  invokeResolver<T extends (...args: any) => any, TInput = FirstParam<T>>(
    queryFn: T,
    params: TInput,
  ): Promise<PromiseReturnType<T>>
  ```

  #### Example Usage

  ```ts
  ...
  import {invokeResolver, useAuthenticatedBlitzContext} from "../src/blitz-server"
  import getCurrentUser from "../src/users/queries/getCurrentUser"

  export default async function Home() {
    await useAuthenticatedBlitzContext({
      redirectTo: "/auth/login",
    })
    const user = await invokeResolver(getCurrentUser, null)
  ...
  ```

- Updated dependencies [cadefb88e]
- Updated dependencies [6f18cbdc9]
- Updated dependencies [acc07ce94]
- Updated dependencies [ea7561b8e]
- Updated dependencies [9529dbd6f]
- Updated dependencies [ea7561b8e]
- Updated dependencies [6e88a847f]
- Updated dependencies [37aeaa7fa]
  - blitz@2.0.0-beta.24
  - @blitzjs/auth@2.0.0-beta.24
  - @blitzjs/next@2.0.0-beta.24
  - @blitzjs/rpc@2.0.0-beta.24
  - @blitzjs/config@2.0.0-beta.24
