Skip to content

Commit

Permalink
upgrade:ui-components(4.5.40-alpha.20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoyafng committed Dec 18, 2024
1 parent 6c8e122 commit 57c28c2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/guard-shim-react18/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"webpack": "^5.72.0"
},
"dependencies": {
"@authing/react18-ui-components": "4.5.40-alpha.19",
"@authing/react18-ui-components": "4.5.40-alpha.20",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
27 changes: 11 additions & 16 deletions packages/guard-shim-react18/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,28 +227,23 @@ export class Guard {
* @returns Promise
*/
async start(el?: string | HTMLElement, visible?: boolean): Promise<User> {
try {
;(this.options.config as Partial<GuardLocalConfig>).target = el
;(this.options.config as Partial<GuardLocalConfig>).target = el

this.visible = visible ?? this.visible
this.visible = visible ?? this.visible

this.render()
this.render()

const userInfo = await this.trackSession()
const userInfo = await this.trackSession()

if (userInfo) {
return Promise.resolve(userInfo)
}
if (userInfo) {
return Promise.resolve(userInfo)
}

return new Promise(resolve => {
this.on('login', (userInfo: User) => {
resolve(userInfo)
})
return new Promise(resolve => {
this.on('login', (userInfo: User) => {
resolve(userInfo)
})
} catch (e) {
console.log(e)
throw new Error(`error ${e}`)
}
})
}

startRegister() {
Expand Down
2 changes: 1 addition & 1 deletion packages/guard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"webpack": "^5.72.0"
},
"dependencies": {
"@authing/react-ui-components": "4.5.40-alpha.19",
"@authing/react-ui-components": "4.5.40-alpha.20",
"axios": "^0.27.2",
"react": "^16.14.0",
"react-dom": "^16.14.0"
Expand Down

0 comments on commit 57c28c2

Please sign in to comment.