-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Leonardo
committed
Mar 7, 2023
1 parent
08d0b5d
commit 186f218
Showing
71 changed files
with
1,409 additions
and
347 deletions.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
|
@@ -6,6 +6,9 @@ | |
/out-tsc | ||
/bazel-out | ||
/template | ||
/.angular | ||
/.history | ||
/.vscode | ||
|
||
# Node | ||
/node_modules | ||
|
Empty file.
Empty file.
Empty file.
Empty file.
Large diffs are not rendered by default.
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
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,7 @@ | ||
export interface IUser { | ||
name: string; | ||
email: string; | ||
password?: string; | ||
age: number; | ||
phoneNumber: string; | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
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,43 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { AngularFireAuth } from '@angular/fire/compat/auth'; | ||
import { | ||
AngularFirestore, | ||
AngularFirestoreCollection, | ||
} from '@angular/fire/compat/firestore'; | ||
import { IUser } from '../models/user.model'; | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class AuthService { | ||
private usersCollection: AngularFirestoreCollection<IUser>; | ||
constructor(private auth: AngularFireAuth, private db: AngularFirestore) { | ||
this.usersCollection = this.db.collection('users'); | ||
} | ||
|
||
public async createUser(userData: IUser) { | ||
if (!userData.password) { | ||
throw new Error('Error is missing!'); | ||
} | ||
const userCredentials = await this.auth.createUserWithEmailAndPassword( | ||
userData.email, | ||
userData.password | ||
); | ||
if (!userCredentials.user) { | ||
throw new Error("User can't be found"); | ||
} | ||
await this.db | ||
.collection<IUser>('users') | ||
.doc(userCredentials.user?.uid) | ||
.set({ | ||
name: userData.name, | ||
email: userData.email, | ||
age: userData.age, | ||
phoneNumber: userData.phoneNumber, | ||
}); | ||
|
||
await userCredentials.user.updateProfile({ | ||
displayName: userData.name, | ||
}); | ||
} | ||
} |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified
0
src/app/shared/tabs-container/tabs-container.component.spec.ts
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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,21 +1,30 @@ | ||
<!-- Login Form --> | ||
<form> | ||
<form #loginForm='ngForm' (ngSubmit)="login()"> | ||
<!-- Email --> | ||
<div class="mb-3"> | ||
<label class="inline-block mb-2">Email</label> | ||
<input type="email" class="block w-full py-1.5 px-3 text-gray-200 border border-gray-400 transition | ||
duration-500 focus:outline-none rounded bg-transparent | ||
focus:border-indigo-400" placeholder="Enter Email" /> | ||
<input #email='ngModel' type="email" name='email' [(ngModel)]='credentials.email' | ||
class="block w-full py-1.5 px-3 text-gray-200 border border-gray-400 transition duration-500 focus:outline-none rounded bg-transparent focus:border-indigo-400" | ||
placeholder="Enter Email" required | ||
pattern="[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?" /> | ||
<p *ngIf="email.errors && email.touched && email.dirty" class='text-red-400'> | ||
Email is invalid | ||
</p> | ||
</div> | ||
<!-- Password --> | ||
<div class="mb-3"> | ||
<label class="inline-block mb-2">Password</label> | ||
<input type="password" class="block w-full py-1.5 px-3 text-gray-200 border border-gray-400 transition | ||
duration-500 focus:outline-none rounded bg-transparent focus:border-indigo-400" | ||
placeholder="Password" /> | ||
<input #password='ngModel' [(ngModel)]='credentials.password' required type="password" | ||
class="block w-full py-1.5 px-3 text-gray-200 border border-gray-400 transition duration-500 focus:outline-none rounded bg-transparent focus:border-indigo-400" | ||
placeholder="Password" [ngModelOptions]="{standalone: true}" /> | ||
<p *ngIf="password.errors && password.touched && password.dirty" class='text-red-400'> | ||
Password is invalid | ||
</p> | ||
</div> | ||
<button type="submit" class="block w-full bg-indigo-400 text-white py-1.5 px-3 rounded transition | ||
hover:bg-indigo-500"> | ||
|
||
<button type="submit" | ||
class="block w-full bg-indigo-400 text-white py-1.5 px-3 rounded transition hover:bg-indigo-500 disabled:opacity-50 disabled:bg-indigo-400" | ||
[disabled]='loginForm.invalid'> | ||
Submit | ||
</button> | ||
</form> |
Empty file.
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
Empty file.
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
Empty file.
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
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,11 @@ | ||
export const environment = { | ||
production: true, | ||
firebaseConfig: { | ||
apiKey: 'AIzaSyC2zxPU3mO3RVDiO-IuGuNd5XVqmiGN3kI', | ||
authDomain: 'clipz-dfbc1.firebaseapp.com', | ||
projectId: 'clipz-dfbc1', | ||
storageBucket: 'clipz-dfbc1.appspot.com', | ||
messagingSenderId: '576704584143', | ||
appId: '1:576704584143:web:d34d242234b6fa15b49aba', | ||
}, | ||
}; |
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,11 @@ | ||
export const environment = { | ||
production: false, | ||
firebaseConfig: { | ||
apiKey: 'AIzaSyC2zxPU3mO3RVDiO-IuGuNd5XVqmiGN3kI', | ||
authDomain: 'clipz-dfbc1.firebaseapp.com', | ||
projectId: 'clipz-dfbc1', | ||
storageBucket: 'clipz-dfbc1.appspot.com', | ||
messagingSenderId: '576704584143', | ||
appId: '1:576704584143:web:d34d242234b6fa15b49aba', | ||
}, | ||
}; |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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
Empty file.