tag:github.com,2008:https://github.com/CrawlerCode/payload-authjs/releases Release notes from payload-authjs 2025-07-29T18:18:25Z tag:github.com,2008:Repository/848986894/v0.8.3 2025-07-29T18:19:30Z v0.8.3 <h2>0.8.3 (2025-07-29)</h2> <h3>🩹 Fixes</h3> <ul> <li>Remove duplicate custom array id fields (<a href="https://github.com/CrawlerCode/payload-authjs/commit/6f0ab0d">6f0ab0d</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Refactor repository and author fields in package.json for better structure (<a href="https://github.com/CrawlerCode/payload-authjs/commit/9b4d548">9b4d548</a>)</li> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/5d1d6a3">5d1d6a3</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.8.2 2025-05-11T13:33:50Z v0.8.2 <h2>0.8.2 (2025-05-11)</h2> <h3>🩹 Fixes</h3> <ul> <li><strong>getPayloadSession:</strong> Don't pass readonly headers object directly to fetch function (<a href="https://github.com/CrawlerCode/payload-authjs/pull/33" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/33/hovercard">#33</a>)</li> </ul> <h3>📖 Documentation</h3> <ul> <li>Add examples section to README (<a href="https://github.com/CrawlerCode/payload-authjs/commit/507385e">507385e</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Improve payload api types for /me and /refresh-token endpoints (<a href="https://github.com/CrawlerCode/payload-authjs/commit/9bf9289">9bf9289</a>)</li> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/1f30898">1f30898</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.8.1 2025-04-14T21:30:29Z v0.8.1 <h2>0.8.1 (2025-04-14)</h2> <h3>🩹 Fixes</h3> <ul> <li>Change the behavior of the SignIn button for login with provider (<a href="https://github.com/CrawlerCode/payload-authjs/pull/24" data-hovercard-type="discussion" data-hovercard-url="/CrawlerCode/payload-authjs/discussions/24/hovercard">#24</a>)</li> <li>Remove email field duplication if enableLocalStrategy (<a href="https://github.com/CrawlerCode/payload-authjs/pull/29" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/29/hovercard">#29</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li><strong>dev:</strong> Allow login with username for local strategy (<a href="https://github.com/CrawlerCode/payload-authjs/commit/b8c24b5">b8c24b5</a>)</li> <li><strong>nx:</strong> Rename examples to example (<a href="https://github.com/CrawlerCode/payload-authjs/commit/a0d1ab9">a0d1ab9</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.8.0 2025-04-06T21:31:08Z v0.8.0 <h2>0.8.0 (2025-04-06)</h2> <h3>🚀 Features</h3> <ul> <li>Add custom account row label component (<a href="https://github.com/CrawlerCode/payload-authjs/commit/89ce1a7">89ce1a7</a>)</li> <li>Add support for other auth strategies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/2c94c40">2c94c40</a>)</li> <li><strong>getPayloadSession:</strong> Cache getPayloadSession function (<a href="https://github.com/CrawlerCode/payload-authjs/commit/ff3b25b">ff3b25b</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li>Merge remaining properties for fields with subfield (<a href="https://github.com/CrawlerCode/payload-authjs/commit/cfa143d">cfa143d</a>)</li> <li>Execute afterLogout hooks at logout endpoint (<a href="https://github.com/CrawlerCode/payload-authjs/pull/16" data-hovercard-type="discussion" data-hovercard-url="/CrawlerCode/payload-authjs/discussions/16/hovercard">#16</a>)</li> <li>Extend PayloadSession with collection and strategy (<a href="https://github.com/CrawlerCode/payload-authjs/commit/4ca2cdf">4ca2cdf</a>)</li> <li>Fix mergeFields function for tabs fields (<a href="https://github.com/CrawlerCode/payload-authjs/commit/bdb393c">bdb393c</a>)</li> <li>Refresh authjs session cookie at payload "refresh-token" endpoint (<a href="https://github.com/CrawlerCode/payload-authjs/commit/66e50fc">66e50fc</a>)</li> <li>Revalidate payload-session tag on logout and refresh (<a href="https://github.com/CrawlerCode/payload-authjs/commit/25d4b8d">25d4b8d</a>)</li> <li>Move from tsc to swc to be compatible with turbopack (<a href="https://github.com/CrawlerCode/payload-authjs/pull/18" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/18/hovercard">#18</a>)</li> <li><strong>AuthjsAuthStrategy:</strong> Respect auth.depth option of users collection (<a href="https://github.com/CrawlerCode/payload-authjs/commit/c06262b">c06262b</a>)</li> <li><strong>PayloadSessionProvider:</strong> Abort fetch session on unmount (<a href="https://github.com/CrawlerCode/payload-authjs/commit/0a5e859">0a5e859</a>)</li> <li><strong>getPayloadSession:</strong> Preferably extract strategy from user._strategy &amp; improved types (<a href="https://github.com/CrawlerCode/payload-authjs/commit/4b66142">4b66142</a>)</li> </ul> <h3>🔥 Performance</h3> <ul> <li><strong>PayloadAdapter:</strong> Only retrieve necessary fields (<a href="https://github.com/CrawlerCode/payload-authjs/commit/6beebd2">6beebd2</a>)</li> </ul> <h3>📖 Documentation</h3> <ul> <li>Add missing import for example (<a href="https://github.com/CrawlerCode/payload-authjs/commit/e3caebc">e3caebc</a>)</li> <li>Improve setup section (<a href="https://github.com/CrawlerCode/payload-authjs/commit/4c54dfd">4c54dfd</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d269d92">d269d92</a>)</li> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d98f3aa">d98f3aa</a>)</li> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/7e6a164">7e6a164</a>)</li> <li><strong>deps:</strong> Set minimal required payload version to 3.16.0 (because export of headersWithCors) (<a href="https://github.com/CrawlerCode/payload-authjs/commit/b76df1a">b76df1a</a>)</li> <li><strong>dev:</strong> Improve edge compatibility and some other small changes (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d5e5d9e">d5e5d9e</a>)</li> <li><strong>dev:</strong> Add token rotation for keycloak provider &amp; sync account expires date with session expires (<a href="https://github.com/CrawlerCode/payload-authjs/commit/27ee17b">27ee17b</a>)</li> <li><strong>dev:</strong> Add mongoose adapter (<a href="https://github.com/CrawlerCode/payload-authjs/commit/b6c4e23">b6c4e23</a>)</li> <li><strong>nx:</strong> Add examples type to changelog (<a href="https://github.com/CrawlerCode/payload-authjs/commit/5e9b181">5e9b181</a>)</li> </ul> <h3>📓 Examples</h3> <ul> <li><strong>multiple-auth-collections:</strong> Add example for using multiple authentication collections (<a href="https://github.com/CrawlerCode/payload-authjs/commit/b0ff26a">b0ff26a</a>)</li> <li><strong>with-payload-local-strategy:</strong> Add example for using payload local strategy (<a href="https://github.com/CrawlerCode/payload-authjs/commit/baa762d">baa762d</a>)</li> <li><strong>basic:</strong> Enable middleware by default (<a href="https://github.com/CrawlerCode/payload-authjs/commit/7374439">7374439</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.7.1 2025-02-09T22:30:43Z v0.7.1 <h2>0.7.1 (2025-02-09)</h2> <h3>🩹 Fixes</h3> <ul> <li>Register me hook always to provider expires timestamp (<a href="https://github.com/CrawlerCode/payload-authjs/pull/12" data-hovercard-type="discussion" data-hovercard-url="/CrawlerCode/payload-authjs/discussions/12/hovercard">#12</a>)</li> <li><strong>PayloadSessionProvider:</strong> Fix broken PayloadSessionProvider (<a href="https://github.com/CrawlerCode/payload-authjs/commit/67df23d">67df23d</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.7.0 2025-04-06T21:33:30Z v0.7.0 <h2>0.7.0 (2025-02-09)</h2> <h3>🚀 Features</h3> <ul> <li>Allow custom tabs field in users collection (<a href="https://github.com/CrawlerCode/payload-authjs/pull/14" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/14/hovercard">#14</a>)</li> <li>Add getPayloadSession &amp; usePayloadSession (<a href="https://github.com/CrawlerCode/payload-authjs/commit/146eebe">146eebe</a>)</li> <li><strong>AuthjsAuthStrategy:</strong> Log a warning if user not found in the database but has an valid authjs session (<a href="https://github.com/CrawlerCode/payload-authjs/commit/1999a20">1999a20</a>)</li> <li><strong>PayloadAdapter:</strong> Added payload logger and log debug messages (<a href="https://github.com/CrawlerCode/payload-authjs/commit/957f589">957f589</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li>Override payload refresh operation &amp; fix session expiration (<a href="https://github.com/CrawlerCode/payload-authjs/pull/12" data-hovercard-type="discussion" data-hovercard-url="/CrawlerCode/payload-authjs/discussions/12/hovercard">#12</a>)</li> </ul> <h3>📖 Documentation</h3> <ul> <li>Add "Getting the payload session" section &amp; improved some other wordings (<a href="https://github.com/CrawlerCode/payload-authjs/commit/f911249">f911249</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Fix eslint &amp; typescript errors (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d9c5895">d9c5895</a>)</li> <li><strong>dev:</strong> Change nextjs port to 5000 (<a href="https://github.com/CrawlerCode/payload-authjs/commit/0115f0e">0115f0e</a>)</li> <li><strong>dev:</strong> Allow js files (for import map) (<a href="https://github.com/CrawlerCode/payload-authjs/commit/3b4b16b">3b4b16b</a>)</li> <li><strong>dev:</strong> Add greeting component to admin dashboard (<a href="https://github.com/CrawlerCode/payload-authjs/commit/becc12a">becc12a</a>)</li> <li><strong>dev:</strong> Added all different options to get the session &amp; add tailwind (<a href="https://github.com/CrawlerCode/payload-authjs/commit/57637ab">57637ab</a>)</li> <li><strong>dev:</strong> Add currentAccount field (<a href="https://github.com/CrawlerCode/payload-authjs/commit/3f1711d">3f1711d</a>)</li> </ul> <h2>DEPRECATION</h2> <p><code>getPayloadUser</code> is now deprecated. You should use <code>getPayloadSession</code> instead:</p> <div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- import { getPayloadUser } from &quot;payload-authjs&quot;; + import { getPayloadSession } from &quot;payload-authjs&quot;; const ServerComponentExample = async () =&gt; { - const payloadUser = await getPayloadUser(); + const session = await getPayloadSession(); return ( &lt;&gt; &lt;h3&gt;Payload CMS User:&lt;/h3&gt; - &lt;pre&gt;{JSON.stringify(payloadUser)}&lt;/pre&gt; + &lt;pre&gt;{JSON.stringify(session?.user)}&lt;/pre&gt; &lt;/&gt; ); };"><pre><span class="pl-md"><span class="pl-md">-</span> import { getPayloadUser } from "payload-authjs";</span> <span class="pl-mi1"><span class="pl-mi1">+</span> import { getPayloadSession } from "payload-authjs";</span> const ServerComponentExample = async () =&gt; { <span class="pl-md"><span class="pl-md">-</span> const payloadUser = await getPayloadUser();</span> <span class="pl-mi1"><span class="pl-mi1">+</span> const session = await getPayloadSession();</span> return ( &lt;&gt; &lt;h3&gt;Payload CMS User:&lt;/h3&gt; <span class="pl-md"><span class="pl-md">-</span> &lt;pre&gt;{JSON.stringify(payloadUser)}&lt;/pre&gt;</span> <span class="pl-mi1"><span class="pl-mi1">+</span> &lt;pre&gt;{JSON.stringify(session?.user)}&lt;/pre&gt;</span> &lt;/&gt; ); };</pre></div> CrawlerCode tag:github.com,2008:Repository/848986894/v0.6.1 2025-02-05T22:53:52Z v0.6.1 <h2>0.6.1 (2025-02-05)</h2> <h3>🩹 Fixes</h3> <ul> <li>Fix findField function for subfields (<a href="https://github.com/CrawlerCode/payload-authjs/pull/13" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/13/hovercard">#13</a>)</li> </ul> <h3>📖 Documentation</h3> <ul> <li>Fix events header (<a href="https://github.com/CrawlerCode/payload-authjs/commit/cce4e4c">cce4e4c</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li><strong>deps:</strong> Update npm dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/804f3f3">804f3f3</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.6.0 2025-01-27T22:13:12Z v0.6.0 <h2>0.6.0 (2025-01-27)</h2> <h3>🚀 Features</h3> <ul> <li>Add support for virtual fields (jwt session strategy) (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d20f863">d20f863</a>)</li> <li>Add PayloadAuthjsUser helper type for authjs module declaration (<a href="https://github.com/CrawlerCode/payload-authjs/commit/c7e8f08">c7e8f08</a>)</li> <li><strong>withPayload:</strong> Add custom evens to withPayload function (<a href="https://github.com/CrawlerCode/payload-authjs/commit/89e749c">89e749c</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li><strong>PayloadAdapter:</strong> Improve data transformation and forward additional fields (<a href="https://github.com/CrawlerCode/payload-authjs/commit/9052f38">9052f38</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Replace banner (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d354a51">d354a51</a>)</li> </ul> CrawlerCode tag:github.com,2008:Repository/848986894/v0.5.0 2025-01-28T17:59:19Z v0.5.0 <h2>0.5.0 (2025-01-25)</h2> <h3>🚀 Features</h3> <ul> <li>Allow to customize the sign in button (<a href="https://github.com/CrawlerCode/payload-authjs/pull/7" data-hovercard-type="issue" data-hovercard-url="/CrawlerCode/payload-authjs/issues/7/hovercard">#7</a>)</li> <li>Improved users collection &amp; add better support for customization (<a href="https://github.com/CrawlerCode/payload-authjs/commit/18810ec">18810ec</a>)</li> <li><strong>basic-example:</strong> Add basic-example project (<a href="https://github.com/CrawlerCode/payload-authjs/commit/76fc27a">76fc27a</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li><strong>PayloadAdapter:</strong> Fix not found error on first sign in (<a href="https://github.com/CrawlerCode/payload-authjs/commit/afd1273">afd1273</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Add github issue template (<a href="https://github.com/CrawlerCode/payload-authjs/commit/5038483">5038483</a>)</li> <li>Update dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/e74b980">e74b980</a>)</li> <li>Move README and add symlink (<a href="https://github.com/CrawlerCode/payload-authjs/commit/8b15168">8b15168</a>)</li> <li>Set minimal required payload version to 3.1.1 (<a href="https://github.com/CrawlerCode/payload-authjs/commit/c621343">c621343</a>)</li> <li>Add banner (<a href="https://github.com/CrawlerCode/payload-authjs/commit/da224a0">da224a0</a>)</li> </ul> <h2>DATABASE SCHEMA CHANGE</h2> <p>Previously, this plugin always added session and verification token tables. Starting from <code>0.5.0</code>, the plugin determines whether you are using these features and adds the fields/tables conditionally. For this reason, the database schema is changed and <strong>you must create a migration</strong>.</p> <p><em>Further information can be found in the discussions <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7884030" data-permission-text="Title is private" data-url="https://github.com/CrawlerCode/payload-authjs/discussions/9" data-hovercard-type="discussion" data-hovercard-url="/CrawlerCode/payload-authjs/discussions/9/hovercard" href="https://github.com/CrawlerCode/payload-authjs/discussions/9">#9</a></em></p> CrawlerCode tag:github.com,2008:Repository/848986894/v0.4.0 2024-12-08T16:12:32Z v0.4.0 <h2>0.4.0 (2024-12-08)</h2> <h3>🚀 Features</h3> <ul> <li>Set default access control (read, update and delete own user) (<a href="https://github.com/CrawlerCode/payload-authjs/commit/edaf753">edaf753</a>)</li> </ul> <h3>🩹 Fixes</h3> <ul> <li><strong>PayloadAdapter:</strong> Check account provider in getUserByAccount method (<a href="https://github.com/CrawlerCode/payload-authjs/commit/75b88c0">75b88c0</a>)</li> </ul> <h3>🏡 Chore</h3> <ul> <li>Migrate to payload 3 stable version (<a href="https://github.com/CrawlerCode/payload-authjs/commit/2db3139">2db3139</a>)</li> <li>Update dependencies (<a href="https://github.com/CrawlerCode/payload-authjs/commit/d7338aa">d7338aa</a>)</li> </ul> CrawlerCode