1
0
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:
Saad Jutt
2021-08-25 07:55:04 +05:00
parent 97918f301b
commit 1a59f95be7
5 changed files with 102 additions and 59 deletions

21
src/auth/openWebPage.ts Normal file
View 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
}