@@ -20,9 +20,9 @@ export const { handlers, auth } = NextAuth({
20
20
providers: [
21
21
Google ({
22
22
profile(profile ) {
23
- return { role: profile .role ?? " user" , ... }
23
+ return { role: profile .role ?? " user" , ... profile }
24
24
},
25
- })
25
+ }),
26
26
],
27
27
})
28
28
```
@@ -39,7 +39,7 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
39
39
providers: [
40
40
Google ({
41
41
profile(profile ) {
42
- return { role: profile .role ?? " user" , ... }
42
+ return { role: profile .role ?? " user" , ... profile }
43
43
},
44
44
})
45
45
],
@@ -58,9 +58,9 @@ export const { handle } = SvelteKitAuth({
58
58
providers: [
59
59
Google ({
60
60
profile(profile ) {
61
- return { role: profile .role ?? " user" , ... }
61
+ return { role: profile .role ?? " user" , ... profile }
62
62
},
63
- })
63
+ }),
64
64
],
65
65
})
66
66
```
@@ -94,20 +94,20 @@ export const { handlers, auth } = NextAuth({
94
94
providers: [
95
95
Google ({
96
96
profile(profile ) {
97
- return { role: profile .role ?? " user" , ... }
97
+ return { role: profile .role ?? " user" , ... profile }
98
98
},
99
- })
99
+ }),
100
100
],
101
101
callbacks: {
102
102
jwt({ token , user }) {
103
- if (user ) token .role = user .role
103
+ if (user ) token .role = user .role
104
104
return token
105
105
},
106
106
session({ session , token }) {
107
107
session .user .role = token .role
108
108
return session
109
- }
110
- }
109
+ },
110
+ },
111
111
})
112
112
```
113
113
@@ -123,7 +123,7 @@ export const { onRequest, useSession, useSignIn, useSignOut } = QwikAuth$(
123
123
providers: [
124
124
Google ({
125
125
profile(profile ) {
126
- return { role: profile .role ?? " user" , ... }
126
+ return { role: profile .role ?? " user" , ... profile }
127
127
},
128
128
})
129
129
],
@@ -152,20 +152,20 @@ export const { handle } = SvelteKitAuth({
152
152
providers: [
153
153
Google ({
154
154
profile(profile ) {
155
- return { role: profile .role ?? " user" , ... }
155
+ return { role: profile .role ?? " user" , ... profile }
156
156
},
157
- })
157
+ }),
158
158
],
159
159
callbacks: {
160
160
jwt({ token , user }) {
161
- if (user ) token .role = user .role
161
+ if (user ) token .role = user .role
162
162
return token
163
163
},
164
164
session({ session , token }) {
165
165
session .user .role = token .role
166
166
return session
167
- }
168
- }
167
+ },
168
+ },
169
169
})
170
170
```
171
171
@@ -213,16 +213,16 @@ export const { handlers, auth } = NextAuth({
213
213
providers: [
214
214
Google ({
215
215
profile(profile ) {
216
- return { role: profile .role ?? " user" , ... }
217
- }
218
- })
216
+ return { role: profile .role ?? " user" , ... profile }
217
+ },
218
+ }),
219
219
],
220
220
callbacks: {
221
221
session({ session , user }) {
222
222
session .user .role = user .role
223
223
return session
224
- }
225
- }
224
+ },
225
+ },
226
226
})
227
227
```
228
228
@@ -263,17 +263,16 @@ export const { handle, auth } = SvelteKitAuth({
263
263
providers: [
264
264
Google ({
265
265
profile(profile ) {
266
- return { role: profile .role ?? " user" , ... }
267
- }
268
- ...
269
- })
266
+ return { role: profile .role ?? " user" , ... profile }
267
+ },
268
+ }),
270
269
],
271
270
callbacks: {
272
271
session({ session , user }) {
273
272
session .user .role = user .role
274
273
return session
275
- }
276
- }
274
+ },
275
+ },
277
276
})
278
277
```
279
278
0 commit comments