-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Connection to firebase Firebae user creation / update / deletion User verification by phone number Updated nominations model to use firebase id Added http strategy to verify user token Comment out v1 authentication
- Loading branch information
1 parent
bea9ed7
commit 0d6f7ac
Showing
41 changed files
with
1,067 additions
and
850 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,5 @@ yarn-error.log* | |
/server-notypes | ||
nodemon.sh | ||
.cache | ||
dist/ | ||
dist/ | ||
service-account-key.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,52 @@ | ||
import { Affiliation } from './affiliation'; | ||
import { Entity, Column, OneToMany, OneToOne, JoinColumn } from 'typeorm'; | ||
import { Household } from './household'; | ||
import AbstractUser from './abstract/user'; | ||
import { Affiliation, Household } from 'cmpd-common-api'; | ||
import { BaseEntity, Column, Entity, JoinColumn, OneToMany, OneToOne, PrimaryColumn } from 'typeorm'; | ||
|
||
@Entity('users') | ||
export class Nominator extends AbstractUser { | ||
@Entity('nominators') | ||
export class Nominator extends BaseEntity { | ||
private constructor(props) { | ||
super(); | ||
|
||
Object.assign(this, props); | ||
} | ||
|
||
@PrimaryColumn('text') id: string; | ||
|
||
@Column('text') name: string; | ||
|
||
@Column('text') email: string; | ||
|
||
@Column('text', { nullable: true }) | ||
rank: string; | ||
|
||
@Column('text', { nullable: true }) | ||
role: string; | ||
|
||
@Column('text', { nullable: true }) | ||
phone: string; | ||
|
||
@Column('boolean', { default: true }) | ||
disabled: boolean; | ||
|
||
@Column('boolean', { name: 'email_verified', default: false }) | ||
emailVerified: boolean; | ||
|
||
@Column('text') phoneNumber: string; | ||
|
||
@Column('int', { name: 'nomination_limit', default: 5 }) | ||
nominationLimit: number; | ||
|
||
@Column('int', { name: 'affiliation_id', nullable: true }) | ||
affiliationId: number; | ||
|
||
@OneToOne(() => Affiliation) | ||
@JoinColumn({ name: 'affiliation_id' }) | ||
affiliation: Affiliation; | ||
|
||
@Column('int', { name: 'nomination_limit', default: 5 }) | ||
nominationLimit: number; | ||
|
||
@OneToMany(() => Household, household => household.nominator) | ||
households: Household[]; | ||
|
||
static fromJSON(props) { | ||
const entity = new Nominator(props); | ||
|
||
return entity; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Get, Controller, Render } from '@nestjs/common'; | ||
|
||
@Controller() | ||
export class AppController { | ||
@Get() | ||
@Render('index') | ||
root() { | ||
return { message: 'Hello world!' }; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './auth.guard'; | ||
export * from './roles.guard'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as admin from 'firebase-admin'; | ||
var serviceAccount = require('../../../service-account-key.json'); | ||
|
||
admin.initializeApp({ | ||
credential: admin.credential.cert(serviceAccount), | ||
databaseURL: 'https://passwordless-auth-a5939.firebaseio.com' | ||
}); | ||
|
||
export default admin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.