mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-05 03:30:05 +00:00
fix: split code to files + corrected usage of loginCallback
This commit is contained in:
21
src/auth/openWebPage.ts
Normal file
21
src/auth/openWebPage.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
interface windowFeatures {
|
||||
width: number
|
||||
height: number
|
||||
}
|
||||
|
||||
export function openWebPage(
|
||||
url: string,
|
||||
windowName: string = '',
|
||||
{ width, height }: windowFeatures
|
||||
): Window | null {
|
||||
const left = screen.width / 2 - width / 2
|
||||
const top = screen.height / 2 - height / 2
|
||||
|
||||
const loginPopup = window.open(
|
||||
url,
|
||||
windowName,
|
||||
`toolbar=0,location=0,menubar=0,width=${width},height=${height},left=${left},top=${top}`
|
||||
)
|
||||
|
||||
return loginPopup
|
||||
}
|
||||
Reference in New Issue
Block a user