You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: use `auth` over `getSession`
Replaces `getSession` with `auth` given that `getSession` is
now deprecated.
Refer to: sveltejs/kit#5883 for context.
The following PR also serves as context for the same
milestone: sveltejs/kit#5946
Copy file name to clipboardExpand all lines: docs/docs/getting-started/providers/oauth-tutorial.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,14 +245,14 @@ or https://generate-secret.vercel.app/32 to generate a random value for it.
245
245
246
246
### Exposing the session via page store
247
247
248
-
Auth.js provides us a getSession, function to access the session data and status, to call from the `event.locals` variable. We can now just call it and add it to our `$page` store.
248
+
Auth.js provides us a `auth`, function to access the session data and status, to call from the `event.locals` variable. We can now just call it and add it to our `$page` store.
@@ -279,14 +279,14 @@ You can use the `$page.data.session` variable from anywhere on your page. Learn
279
279
280
280
### Protecting API Routes
281
281
282
-
To protect your API Routes (blocking unauthorized access to resources), you can use `locals.getSessions()` just like in the layouts file to know whether a session exists or not:
282
+
To protect your API Routes (blocking unauthorized access to resources), you can use `locals.auth()` just like in the layouts file to know whether a session exists or not:
0 commit comments