Skip to content

Commit aca4a51

Browse files
feat(ory): init (#2)
* feat(ory): init * chore(common): bump yarn * chore(common): format files * chore(common): install dependencies --------- Co-authored-by: Dmitry <dimafomin02@gmail.com>
1 parent fadb55c commit aca4a51

File tree

17 files changed

+16729
-4096
lines changed

17 files changed

+16729
-4096
lines changed

.github/ISSUE_TEMPLATE/bug.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,4 @@ body:
5858
validations:
5959
required: true
6060

61-
projects: ['atls/11']
61+
projects: ['atls/11']

.github/ISSUE_TEMPLATE/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ body:
4141
validations:
4242
required: true
4343

44-
projects: ['atls/11']
44+
projects: ['atls/11']

.github/ISSUE_TEMPLATE/feature.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ body:
4444
validations:
4545
required: true
4646

47-
projects: ['atls/11']
47+
projects: ['atls/11']

.pnp.cjs

Lines changed: 9151 additions & 2443 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/releases/yarn-remote.mjs

Lines changed: 1421 additions & 1157 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
{
2-
"name": "template",
2+
"name": "react-native",
33
"private": true,
44
"license": "BSD 3-Clause",
55
"type": "module",
6+
"workspaces": [
7+
"packages/*"
8+
],
69
"devDependencies": {
7-
"@atls/code-runtime": "2.0.7",
10+
"@atls/code-runtime": "2.1.2",
811
"@types/node": "22.10.2",
912
"eslint": "9.17.0",
1013
"typescript": "5.5.4"
1114
},
12-
"packageManager": "yarn@4.5.3"
15+
"packageManager": "yarn@4.6.0",
16+
"tools": {
17+
"schematic": {
18+
"collection": "@atls/schematics",
19+
"schematic": "project",
20+
"type": "libraries",
21+
"migration": "1943133755669"
22+
}
23+
},
24+
"typecheckSkipLibCheck": true
1325
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@atls/react-native-kratos",
3+
"version": "0.0.0",
4+
"license": "BSD-3-Clause",
5+
"main": "src/index.ts",
6+
"files": [
7+
"dist"
8+
],
9+
"scripts": {
10+
"build": "yarn library build",
11+
"prepack": "yarn run build",
12+
"postpack": "rm -rf dist"
13+
},
14+
"dependencies": {
15+
"@atls/react-kratos": "0.0.2"
16+
},
17+
"devDependencies": {
18+
"@react-native-async-storage/async-storage": "^1.21.0",
19+
"@types/react": "^18.2.45",
20+
"@types/react-dom": "^18.2.18",
21+
"expo-auth-session": "^5.4.0",
22+
"expo-secure-store": "^12.8.1",
23+
"react": "^18.2.0",
24+
"react-dom": "^18.2.0",
25+
"react-native": "^0.73.1"
26+
},
27+
"peerDependencies": {
28+
"@react-native-async-storage/async-storage": "^1",
29+
"expo-auth-session": "^5",
30+
"expo-secure-store": "^12",
31+
"react": "^18.0.0",
32+
"react-native": "^0.73.0"
33+
},
34+
"publishConfig": {
35+
"access": "public",
36+
"main": "dist/index.js",
37+
"typings": "dist/index.d.ts"
38+
},
39+
"typecheckSkipLibCheck": true
40+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './react-native-login.flow'
2+
export * from './react-native-registration.flow'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import type { ReactNode } from 'react'
2+
import type { ReactElement } from 'react'
3+
4+
import { LoginNativeFlow } from '@atls/react-kratos'
5+
import { makeRedirectUri } from 'expo-auth-session'
6+
import React from 'react'
7+
8+
import { useAuth } from '../hooks'
9+
10+
export interface ReactNativeLoginFlowProps {
11+
route: { params?: { aal?: 'aal1' | 'aal2'; refresh?: boolean } }
12+
children: ReactNode
13+
}
14+
15+
export const ReactNativeLoginFlow = ({
16+
children,
17+
route,
18+
}: ReactNativeLoginFlowProps): ReactElement => {
19+
const { sessionToken, setSession } = useAuth()
20+
21+
return (
22+
<LoginNativeFlow
23+
aal={route.params?.aal}
24+
refresh={route.params?.refresh}
25+
sessionToken={sessionToken}
26+
returnTo={makeRedirectUri({
27+
preferLocalhost: true,
28+
path: '/Callback',
29+
})}
30+
onSession={setSession}
31+
>
32+
{children}
33+
</LoginNativeFlow>
34+
)
35+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { ReactNode } from 'react'
2+
import type { ReactElement } from 'react'
3+
4+
import { RegistrationNativeFlow } from '@atls/react-kratos'
5+
import React from 'react'
6+
7+
import { useAuth } from '../hooks'
8+
9+
export interface ReactNativeRegistrationFlowProps {
10+
children: ReactNode
11+
}
12+
13+
export const ReactNativeRegistrationFlow = ({
14+
children,
15+
}: ReactNativeRegistrationFlowProps): ReactElement => {
16+
const { setSession } = useAuth()
17+
18+
return <RegistrationNativeFlow onSession={setSession}>{children}</RegistrationNativeFlow>
19+
}

0 commit comments

Comments
 (0)