2
0

(auth) Add custom OAuth provider support

Closes #42
This commit is contained in:
Baptiste Arnaud
2023-01-02 08:29:46 +01:00
parent 60ed0b2d4a
commit b9d38935a6
4 changed files with 67 additions and 1 deletions

View File

@ -303,3 +303,17 @@ export const injectCustomHeadCode = (customHeadCode: string) => {
document.head.append(noScriptElement)
})
}
export const getAtPath = <T>(obj: T, path: string): unknown => {
if (isNotDefined(obj)) return undefined
const pathParts = path.split('.')
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let current: any = obj
for (const part of pathParts) {
if (current === undefined) {
return undefined
}
current = current[part]
}
return current
}