-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Showing
39 changed files
with
766 additions
and
92 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,58 @@ | ||
<br> | ||
<p align="center"> | ||
<a href="https://manifest.build/#gh-light-mode-only"> | ||
<img alt="manifest" src="https://manifest.build/assets/images/logo-transparent.svg" height="55px" alt="Manifest logo" title="Manifest - A backend so simple that it fits in a YAML file" /> | ||
</a> | ||
<a href="https://manifest.build/#gh-dark-mode-only"> | ||
<img alt="manifest" src="https://manifest.build/assets/images/logo-light.svg" height="55px" alt="Manifest logo" title="Manifest - A backend so simple that it fits in a YAML file" /> | ||
</a> | ||
</p> | ||
|
||
<p align='center'> | ||
<strong>A backend so simple that it fits into 1 YAML file</strong> | ||
<br><br> | ||
<a href="https://www.npmjs.com/package/manifest" target="_blank"><img alt="npm" src="https://img.shields.io/npm/v/manifest"></a> | ||
<a href="https://www.codefactor.io/repository/github/mnfst/manifest" target="_blank"><img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/mnfst/manifest"></a> | ||
<a href="https://discord.com/invite/FepAked3W7" target="_blank"><img alt="Discord" src="https://img.shields.io/discord/1089907785178812499?label=discord"></a> | ||
<a href="https://opencollective.com/mnfst" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a> | ||
<a href="https://www.codetriage.com/mnfst/manifest" target="_blank"><img alt="CodeTriage" src="https://www.codetriage.com/mnfst/manifest/badges/users.svg"></a> | ||
<a href="https://github.com/mnfst/manifest/blob/develop/LICENSE" target="_blank"><img alt="License MIT" src="https://img.shields.io/badge/licence-MIT-green"></a> | ||
<br> | ||
</p> | ||
|
||
## Description | ||
|
||
This project was made with [Manifest](https://github.com/mnfst/manifest). | ||
|
||
## Installation | ||
|
||
```bash | ||
$ npm install | ||
``` | ||
|
||
## Running the app | ||
|
||
To run the app in the development mode: | ||
|
||
```bash | ||
npm run manifest | ||
``` | ||
|
||
- Open [http://localhost:1111](http://localhost:1111) to open your admin UI it in your browser | ||
- Open [http://localhost:1111/api](http://localhost:111/api) to view your REST API documentation | ||
|
||
The page will reload when you make changes. | ||
|
||
## Seed dummy data | ||
|
||
Seeds some dummy data for your entities: | ||
|
||
```bash | ||
npm run manifest:seed | ||
``` | ||
|
||
## Community & Resources | ||
|
||
- [Docs](https://manifest.build/docs) - Get started with Manifest | ||
- [Discord](https://discord.gg/FepAked3W7) - Come chat with the community | ||
- [Github](https://github.com/mnfst/manifest/issues) - Report bugs and share ideas to improve the product. |
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
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
23 changes: 23 additions & 0 deletions
23
packages/core/admin/src/app/modules/auth/guards/is-db-empty.guard.ts
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,23 @@ | ||
import { Injectable } from '@angular/core' | ||
import { Router } from '@angular/router' | ||
import { AuthService } from '../auth.service' | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class IsDbEmptyGuard { | ||
constructor( | ||
private authService: AuthService, | ||
private router: Router | ||
) {} | ||
async canActivate(): Promise<boolean> { | ||
const isDbEmpty = await this.authService.isDbEmpty() | ||
|
||
if (isDbEmpty) { | ||
return true | ||
} | ||
|
||
this.router.navigate(['/auth/login']) | ||
return false | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/core/admin/src/app/modules/auth/utlis/confirm-password-validator.ts
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,22 @@ | ||
import { AbstractControl, ValidationErrors, ValidatorFn } from '@angular/forms' | ||
|
||
export function confirmPasswordValidator( | ||
passwordControlName: string | ||
): ValidatorFn { | ||
return (control: AbstractControl): ValidationErrors | null => { | ||
const formGroup = control.parent | ||
if (!formGroup) return null | ||
|
||
const passwordControl = formGroup.get(passwordControlName) | ||
if (!passwordControl) return null | ||
|
||
const password = passwordControl.value | ||
const confirmPassword = control.value | ||
|
||
if (!confirmPassword || password !== confirmPassword) { | ||
return { confirmPasswordMismatch: true } | ||
} | ||
|
||
return null | ||
} | ||
} |
Oops, something went wrong.