Skip to content
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

🛡️ Security/2024 04 #16

Closed
wants to merge 9 commits into from
Closed
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
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
nodejs 16.4.0
nodejs 20.12.2
yarn 1.22.19
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

React Native SDK for Cryptr Authentication through SSO

Current version: `0.3.2`

## Summary

- [@cryptr/cryptr-react-native](#cryptrcryptr-react-native)
- [Summary](#summary)
- [Expo integration](#expo-integration)
- [Cryptr Expo plugin for Android](#cryptr-expo-plugin-for-android)
- [Prerequisites](#prerequisites)
- [Android](#android)
- [iOS](#ios)
Expand All @@ -32,7 +35,26 @@ React Native SDK for Cryptr Authentication through SSO

## Expo integration

:warning: this is not compatible with Expo Go (neither `link`) and requires a run (`expo run`)
:warning: this is straightforward compatible with Expo

Here is an example of a plugin to be compatible with Expo for Android manifest configuration

### Cryptr Expo plugin for Android

```js
const { withAppBuildGradle } = require("@expo/config-plugins");
module.exports = function withAndroidStrategiesPlugin(config) {
return withAppBuildGradle(config, (config) => {
config.modResults.contents = config.modResults.contents.replace(
"targetSdkVersion rootProject.ext.targetSdkVersion",
'targetSdkVersion rootProject.ext.targetSdkVersion\n manifestPlaceholders = [cryptrDomain: YOUR-DOMAIN, cryptrScheme: "cryptr"]'
);
return config;
});
};
```

## Prerequisites

Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- boost-for-react-native (1.63.0)
- cryptr-cryptr-react-native (0.3.0):
- cryptr-cryptr-react-native (0.3.2):
- React-Core
- DoubleConversion (1.1.6)
- FBLazyVector (0.63.5)
Expand Down Expand Up @@ -342,7 +342,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
cryptr-cryptr-react-native: ff44a530cec41f6804757cf87279969b0949334a
cryptr-cryptr-react-native: 6f2e654fb900e068021fbd52bb9c93bd0b159b67
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 352a8ca9bbc8e2f097d680747a8c97ecef12d469
FBReactNativeSpec: 7dfb84f624136a45727c813ed21d130cd3e61beb
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cryptr/cryptr-react-native",
"version": "0.3.0",
"version": "0.3.2",
"description": "React Native SDK for Cryptr Authentication",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand All @@ -21,6 +21,9 @@
"!**/__fixtures__",
"!**/__mocks__"
],
"config": {
"iphone_simulator": "iPhone 15"
},
"scripts": {
"test": "jest",
"test:ci": "jest --coverage",
Expand All @@ -30,6 +33,7 @@
"release": "npm login && npm ping && npm whoami && release-it",
"example": "yarn --cwd example",
"ios:example": "cd example && yarn ios",
"ios:example:with_simulator": "cd example && yarn ios --simulator=\"$npm_package_config_iphone_simulator\"",
"android:example": "cd example && yarn android",
"pods": "cd example && pod-install --quiet",
"bootstrap": "yarn example && yarn && yarn pods"
Expand Down
3 changes: 1 addition & 2 deletions src/components/CryptrGatewayButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const CryptrGatewayButton = ({
signInWithEmail,
} = useCryptr();

if (email !== undefined) checkEmailValue(email);
checkDomainValue(domain);
email !== undefined ? checkEmailValue(email) : checkDomainValue(domain);

const textValue = (): string => {
if (text) {
Expand Down
Loading
Loading