Move ProviderEnum and PassportProfile to web/auth/utils.ts

These two are directly related with auth stuff and seem to fit much better there.

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-06-06 19:59:53 +02:00
parent 4e7c82dc3b
commit 5852b45bdd
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB
6 changed files with 30 additions and 31 deletions

View file

@ -1,6 +1,6 @@
import { Profile } from 'passport'
import { User } from '../../models'
import { logger } from '../../logger'
import { User } from '../../models'
export function passportGeneralCallback (
accessToken: string,
@ -48,3 +48,26 @@ export function passportGeneralCallback (
return done(err, undefined)
})
}
export enum ProviderEnum {
facebook = 'facebook',
twitter = 'twitter',
github = 'github',
gitlab = 'gitlab',
dropbox = 'dropbox',
google = 'google',
ldap = 'ldap',
oauth2 = 'oauth2',
saml = 'saml',
}
export type PassportProfile = {
id: string;
username: string;
displayName: string;
emails: string[];
avatarUrl: string;
profileUrl: string;
provider: ProviderEnum;
photos: { value: string }[];
}