Skip to content

Commit

Permalink
Merge branch 'develop' into features/testing-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bricks666 authored Jan 28, 2024
2 parents c18ec06 + 533d55c commit aea8e59
Show file tree
Hide file tree
Showing 7 changed files with 282 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ CLIENT_APP_HOST='url to root of client app'
## Email
EMAIL_HOST='your smpt email host'
EMAIL_USER='your email user'
EMAIL_PASS='password for your email password'
EMAIL_FROM='sender'
EMAIL_PORT='smpt port'
EMAIL_CLIENT_ID='client ig'
EMAIL_CLIENT_SECRET='client secret'
EMAIL_REFRESH_TOKEN='refresh token'
44 changes: 44 additions & 0 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker

on:
push:
tags: [ 'v*.*.*' ]
branches: [ "main" ]
pull_request:
branches: [ "main", "develop" ]


jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: bricks667/abctasks-server

- name: Extract package version
run: |
echo "TAG=$(jq -r '.version' package.json)" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.meta.outputs.tags }}
v${{ env.TAG }}
labels: ${{ steps.meta.outputs.labels }}
182 changes: 181 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "1.0.0",
"version": "2.2.1",
"description": "",
"main": "./dist/index.js",
"scripts": {
Expand Down Expand Up @@ -33,6 +33,7 @@
"class-validator": "^0.14.0",
"cookie-parser": "^1.4.6",
"express": "^4.18.2",
"googleapis": "^131.0.0",
"handlebars": "^4.7.7",
"nodemailer": "^6.9.1",
"redis": "^4.6.5",
Expand Down
1 change: 1 addition & 0 deletions src/auth/controllers/auth.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export class AuthController {
type: AuthenticationResultDto,
description: 'Данные пользователя и пара токенов',
})
@DisableIsActivatedCheck()
@DisableAuthCheck()
@Post('login')
async login(
Expand Down
3 changes: 1 addition & 2 deletions src/auth/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
BadRequestException,
ConflictException,
ForbiddenException,
Injectable,
Expand Down Expand Up @@ -78,7 +77,7 @@ export class AuthService {
const user = await this.usersService.getInsecure({ email, });

if (!user.activated) {
throw new BadRequestException('User is not activated');
throw new ConflictException('User is not activated');
}

const isValidPassword = await compare(password, user.password);
Expand Down
Loading

0 comments on commit aea8e59

Please sign in to comment.