Skip to content

[Do Not Merge] RN 79.1 upgrade #1147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,56 @@
const path = require('path');

module.exports = {
root: true,
extends: '@react-native-community',
ignorePatterns: [
'app.plugin.js',
'.eslintrc.js',
'cli.js',
'react-native.config.js',
'docs',
'example',
],

parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'react-hooks'],

extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],

parserOptions: {
project: path.join(__dirname, 'tsconfig.json'),
},

env: {
es2022: true,
},

rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',

'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-check': true, 'ts-expect-error': false },
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
],

'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
},
};
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run precommit
10 changes: 0 additions & 10 deletions .snyk
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ ignore:
reason: No fix available
expires: 2025-05-12T09:15:05.191Z
created: 2025-02-02T05:47:18.380Z
SNYK-JS-BABELHELPERS-9397697:
- '*':
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
expires: 2025-05-12T09:15:05.191Z
created: 2025-03-12T09:15:05.191Z
SNYK-JS-IMAGESIZE-9634164:
- '*':
reason: This issue is temporarily ignored untill there is a new release of react native fixed this issue.
expires: 2025-05-12T09:15:05.191Z
created: 2025-04-07T09:15:05.191Z
snyk:lic:npm:lightningcss-win32-x64-msvc:MPL-2.0:
- '*':
reason: This issue is temporarily ignored while we evaluate alternative dependencies or wait for an update from Expo/Metro.
Expand Down
33 changes: 16 additions & 17 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,11 @@ const auth0 = new Auth0({
clientId: 'YOUR_AUTH0_CLIENT_ID',
headers: {
'Accept-Language': 'fr-CA',
'X-Tracking-Id': 'user-tracking-id-123'
}
'X-Tracking-Id': 'user-tracking-id-123',
},
});
```


#### Using custom headers with Auth0Provider component

If you're using the hooks-based approach with Auth0Provider, you can provide headers during initialization:
Expand All @@ -209,31 +208,31 @@ import { Auth0Provider } from 'react-native-auth0';
clientId={'YOUR_CLIENT_ID'}
headers={{
'Accept-Language': 'fr-CA',
'X-App-Version': '1.2.3'
'X-App-Version': '1.2.3',
}}
>
<App />
</Auth0Provider>
</Auth0Provider>;
```


#### Set request-specific headers

You can also provide headers for specific API calls, which will override global headers with the same name:

```js
// For specific authentication requests
auth0.auth.passwordRealm({
username: '[email protected]',
password: 'password',
realm: 'myconnection',
headers: {
'X-Custom-Header': 'request-specific-value',
'X-Request-ID': 'unique-request-id-456'
}
})
.then(console.log)
.catch(console.error);
auth0.auth
.passwordRealm({
username: '[email protected]',
password: 'password',
realm: 'myconnection',
headers: {
'X-Custom-Header': 'request-specific-value',
'X-Request-ID': 'unique-request-id-456',
},
})
.then(console.log)
.catch(console.error);
```

## Management API (Users)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ import { Auth0Provider } from 'react-native-auth0';

const App = () => {
return (
<Auth0Provider
domain="YOUR_AUTH0_DOMAIN"
<Auth0Provider
domain="YOUR_AUTH0_DOMAIN"
clientId="YOUR_AUTH0_CLIENT_ID"
headers={{ 'X-Custom-Header': 'custom-value' }}
>
Expand Down Expand Up @@ -390,9 +390,10 @@ const auth0 = new Auth0({
clientId: 'YOUR_AUTH0_CLIENT_ID',
headers: {
'X-Custom-Header': 'custom-value',
}
},
});
```

</details>

Then import the hook into a component where you want to get access to the properties and methods for integrating with Auth0:
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
presets: ['module:@react-native/babel-preset'],
sourceMaps: true,
};
Loading
Loading