Skip to content

Commit d68fb4b

Browse files
committed
v8.4.3
1 parent d31d7a8 commit d68fb4b

File tree

99 files changed

+700
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+700
-379
lines changed

__fixtures__/test-project/api/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
6-
"@redwoodjs/api": "8.4.2",
7-
"@redwoodjs/auth-dbauth-api": "8.4.2",
8-
"@redwoodjs/graphql-server": "8.4.2"
6+
"@redwoodjs/api": "8.4.3",
7+
"@redwoodjs/auth-dbauth-api": "8.4.3",
8+
"@redwoodjs/graphql-server": "8.4.3"
99
}
1010
}

__fixtures__/test-project/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
]
88
},
99
"devDependencies": {
10-
"@redwoodjs/core": "8.4.2",
11-
"@redwoodjs/project-config": "8.4.2"
10+
"@redwoodjs/core": "8.4.3",
11+
"@redwoodjs/project-config": "8.4.3"
1212
},
1313
"eslintConfig": {
1414
"extends": "@redwoodjs/eslint-config",

__fixtures__/test-project/web/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
]
1212
},
1313
"dependencies": {
14-
"@redwoodjs/auth-dbauth-web": "8.4.2",
15-
"@redwoodjs/forms": "8.4.2",
16-
"@redwoodjs/router": "8.4.2",
17-
"@redwoodjs/web": "8.4.2",
14+
"@redwoodjs/auth-dbauth-web": "8.4.3",
15+
"@redwoodjs/forms": "8.4.3",
16+
"@redwoodjs/router": "8.4.3",
17+
"@redwoodjs/web": "8.4.3",
1818
"humanize-string": "2.1.0",
1919
"react": "18.3.1",
2020
"react-dom": "18.3.1"
2121
},
2222
"devDependencies": {
23-
"@redwoodjs/vite": "8.4.2",
23+
"@redwoodjs/vite": "8.4.3",
2424
"@types/react": "^18.2.55",
2525
"@types/react-dom": "^18.2.19",
2626
"autoprefixer": "^10.4.20",

docs/versioned_docs/version-8.4/auth/azure.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ To add roles exposed via the `roles` claim, follow [Add app roles to your applic
107107
## `logIn` Options
108108

109109
`options` in `logIn(options?)` is of type [RedirectRequest](https://azuread.github.io/microsoft-authentication-library-for-js/ref/types/_azure_msal_browser.RedirectRequest.html) and is a good place to pass in optional [scopes](https://docs.microsoft.com/en-us/graph/permissions-reference#user-permissions) to be authorized.
110-
By default, MSAL sets `scopes` to [/.default](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#the-default-scope) which is built in for every application that refers to the static list of permissions configured on the application registration. Furthermore, MSAL will add `openid` and `profile` to all requests. In the example below we explicit include `User.Read.All` in the login scope.
110+
By default, MSAL sets `scopes` to [/.default](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-permissions-and-consent#the-default-scope) which is built in for every application that refers to the static list of permissions configured on the application registration. Furthermore, MSAL will add `openid`, `profile` and `offline_access` to all requests. In the example below we explicit include `User.Read.All` in the login scope.
111111

112112
```jsx
113113
await logIn({
114-
scopes: ['User.Read.All'], // becomes ['openid', 'profile', 'User.Read.All']
114+
scopes: ['User.Read.All'], // becomes ['openid', 'profile', 'offline_access', 'User.Read.All']
115115
})
116116
```
117117

docs/versioned_docs/version-8.4/auth/dbauth.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,16 @@ By default no setting is required. This is because each db has its own rules for
314314

315315
These options determine how the cookie that tracks whether the client is authorized is stored in the browser. The default configuration should work for most use cases. If you serve your web and api sides from different domains you'll need to make some changes: set `SameSite` to `None` and then add [CORS configuration](#cors-config).
316316

317-
```js title="api/src/functions/auth.js"
317+
```javascript
318318
cookie: {
319319
attributes: {
320320
HttpOnly: true,
321321
Path: '/',
322-
SameSite: 'Strict',
322+
SameSite: 'Lax',
323323
Secure: true,
324324
// Domain: 'example.com',
325325
},
326-
// name: 'session_%port%'
326+
// name: 'session_%port%',
327327
}
328328
```
329329

@@ -360,7 +360,7 @@ cookie: {
360360
attributes: {
361361
HttpOnly: true,
362362
Path: '/',
363-
SameSite: 'Strict',
363+
SameSite: 'Lax',
364364
Secure: process.env.NODE_ENV !== 'development' ? true : false,
365365
// highlight-next-line
366366
Domain: 'example.com'
@@ -564,9 +564,9 @@ export const handler = async (event, context) => {
564564
attributes: {
565565
HttpOnly: true,
566566
Path: '/',
567-
SameSite: 'Strict',
567+
SameSite: 'Lax',
568568
Secure: process.env.NODE_ENV !== 'development' ? true : false,
569-
}
569+
},
570570
},
571571

572572
forgotPassword: forgotPasswordOptions,

docs/versioned_docs/version-8.4/cli-commands.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@ Starts Storybook locally
21262126
yarn redwood storybook
21272127
```
21282128
2129-
[Storybook](https://storybook.js.org/docs/7/get-started/install) is a tool for UI development that allows you to develop your components in isolation, away from all the conflated cruft of your real app.
2129+
[Storybook](https://storybook.js.org/docs/6/get-started/install) is a tool for UI development that allows you to develop your components in isolation, away from all the conflated cruft of your real app.
21302130
21312131
> "Props in, views out! Make it simple to reason about."
21322132

docs/versioned_docs/version-8.4/cors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ const authHandler = new DbAuthHandler(event, context, {
109109
cookie: {
110110
HttpOnly: true,
111111
Path: '/',
112-
SameSite: 'Strict',
112+
SameSite: 'Lax',
113113
Secure: true,
114114
},
115115
forgotPassword: forgotPasswordOptions,

docs/versioned_docs/version-8.4/how-to/custom-function.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ from the web side would give you an error like:
6060
Access to fetch at 'http://localhost:8911/serverTime' from origin 'http://localhost:8910' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
6161
```
6262

63-
We could set the headers for `serverTime` to allow requests from any origin... but maybe a better idea would be to never request `8911` from `8910` in the first place. Hence the `apiUrl`! We're making a request to `8910/.redwood/functions/serverTime`—still the same domain—but [Vite](https://github.com/redwoodjs/redwood/blob/main/packages/vite/src/index.ts#L119) proxies them to `localhost:8911/serverTime` for us.
63+
We could set the headers for `serverTime` to allow requests from any origin... but maybe a better idea would be to never request `8911` from `8910` in the first place. Hence the `apiUrl`! We're making a request to `8910/.redwood/functions/serverTime`—still the same domain—but [Vite](https://github.com/redwoodjs/redwood/blob/main/packages/vite/src/index.ts#L119) proxies them to `localhost:8911/serverTime` for us. Since we can access the `apiUrl` on the frontend via [environment variables](../environment-variables#accessing-api-urls), we can now change the above fetch to work in development as well as in production:
64+
65+
```javascript
66+
const serverTime = await fetch(globalThis.RWJS_API_URL + '/serverTime')
67+
```
68+
69+
> Note: If you want to use [Redwood Authentication](https://docs.redwoodjs.com/docs/serverless-functions/#serverless-functions-with-redwood-user-authentication) on your custom function, your fetch needs to send credentials in a cookie via `fetch(globalThis.RWJS_API_URL + '/serverTime', { credentials: 'include' })`. If you are using dbAuth you might need to add the [Domain](https://docs.redwoodjs.com/docs/auth/dbauth/#cookie-domain) property to your cookie configuration.
6470
6571
## Getting the Time
6672

docs/versioned_docs/version-8.4/how-to/oauth.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
If you're using an auth provider like [Auth0](/docs/auth/auth0), OAuth login to third party services (GitHub, Google, Facebook) is usually just a setting you can toggle on in your provider's dashboard. But if you're using [dbAuth](/docs/auth/dbauth) you'll only have username/password login to start. But, adding one or more OAuth clients isn't hard. This recipe will walk you through it from scratch, adding OAuth login via GitHub.
44

5+
Alternatively, consider using the [redwoodjs-dbauth-oauth](https://github.com/spoonjoy/redwoodjs-dbauth-oauth) community package. This package streamlines the setup, includes support for multiple providers, and even includes UI components that you can use for making setup even easier.
6+
7+
If you do prefer to set this up manually or are just curious how OAuth and dbAuth can work together, read on!
8+
59
## Prerequisites
610

711
This article assumes you have an app set up and are using dbAuth. We're going to make use of the dbAuth system to validate that you're who you say you are. If you just want to try this code out in a sandbox app, you can create a test blog app from scratch by checking out the [Redwood codebase](https://github.com/redwoodjs/redwood) itself and then running a couple of commands:
@@ -636,7 +640,7 @@ const secureCookie = (user) => {
636640
`Expires=${expires.toUTCString()}`,
637641
'HttpOnly=true',
638642
'Path=/',
639-
'SameSite=Strict',
643+
'SameSite=Lax',
640644
`Secure=${process.env.NODE_ENV !== 'development'}`,
641645
]
642646
const data = JSON.stringify({ id: user.id })
@@ -731,7 +735,7 @@ const secureCookie = (user) => {
731735
`Expires=${expires.toUTCString()}`,
732736
'HttpOnly=true',
733737
'Path=/',
734-
'SameSite=Strict',
738+
'SameSite=Lax',
735739
`Secure=${process.env.NODE_ENV !== 'development'}`,
736740
]
737741
const data = JSON.stringify({ id: user.id })

0 commit comments

Comments
 (0)