mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Fix update trigger in nextauth
This commit is contained in:
parent
fc6f1ce11f
commit
702db8de56
@ -169,7 +169,13 @@ export const authOptions = {
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
callbacks: {
|
callbacks: {
|
||||||
async jwt({ token, user, account }) { // Add 'account' parameter here
|
async jwt({ token, user, account, trigger }) {
|
||||||
|
if (trigger === "update" && account?.provider !== "anonymous") {
|
||||||
|
// if we trigger an update call the authorize function again
|
||||||
|
const newUser = await authorize(token.user.pubkey);
|
||||||
|
token.user = newUser;
|
||||||
|
}
|
||||||
|
|
||||||
if (user) {
|
if (user) {
|
||||||
token.user = user;
|
token.user = user;
|
||||||
if (user.pubkey && user.privkey) {
|
if (user.pubkey && user.privkey) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user