Skip to content

Commit cfd8c04

Browse files
test: run examples for version 5.2.3-alpha.0 🚀
1 parent 9c929e9 commit cfd8c04

5 files changed

Lines changed: 65 additions & 52 deletions

File tree

examples/guard-nextjs-react18/package-lock.json

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

examples/guard-nextjs-react18/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"lint": "next lint"
1010
},
1111
"dependencies": {
12-
"@authing/guard-react18": "^5.2.2-alpha.0",
12+
"@authing/guard-react18": "^5.2.3-alpha.0",
1313
"@types/node": "18.11.9",
1414
"@types/react": "18.0.24",
1515
"@types/react-dom": "18.0.8",

examples/guard-nextjs-react18/pages/index.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
import Head from 'next/head'
22

3+
import { useEffect } from 'react'
4+
5+
import { Guard } from '@authing/guard-react18'
6+
7+
import { guardOptions } from '../config'
8+
39
export default function Home () {
10+
const guard = new Guard(guardOptions)
411
const toEmbed = () => window.location.href = '/login'
512
const toJump = () => window.location.href = '/jump'
613

14+
useEffect(() => {
15+
guard.trackSession().then(userInfo => {
16+
console.log('userInfo in index trackSession: ', userInfo)
17+
})
18+
}, [])
19+
720
return <div>
821
<div style={{marginBottom: '20px'}} onClick={toEmbed}><button>嵌入模式</button></div>
922
<div><button onClick={toJump}>跳转模式</button></div>

examples/guard-react18/normal/package-lock.json

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

examples/guard-react18/normal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"webpack-merge": "^4.2.1"
2525
},
2626
"dependencies": {
27-
"@authing/guard-react18": "^5.2.1",
27+
"@authing/guard-react18": "^5.2.3-alpha.0",
2828
"antd": "^4.24.0",
2929
"face-api.js": "^0.22.2",
3030
"react": "^18.2.0",

0 commit comments

Comments
 (0)