From 51f6da549aad3ff9ab7e195b8d8226c5bd982258 Mon Sep 17 00:00:00 2001
From: Bayu Samudra <13520128@std.stei.itb.ac.id>
Date: Fri, 17 Feb 2023 00:09:07 +0000
Subject: [PATCH] Revert "Merge branch 'feat/s1-sb4-implement-register-api'
 into 'main'"

This reverts merge request !7
---
 .env                                 |   6 +-
 .vscode/launch.json                  |  15 ---
 README.md                            |  72 +-------------
 di.go                                |   4 -
 docs/docs.go                         | 137 +--------------------------
 docs/swagger.json                    | 137 +--------------------------
 docs/swagger.yaml                    |  94 +-----------------
 go.mod                               |  17 +---
 go.sum                               |  20 ----
 handler/auth/handler.go              |   2 -
 handler/auth/login.go                |  46 +++------
 handler/auth/refresh.go              |  19 +---
 handler/auth/register.go             |  77 ---------------
 handler/auth/types.go                |   1 -
 model/domain/user/role.go            |   6 +-
 model/domain/user/user.go            |  10 +-
 model/web/auth/register/request.go   |  17 ----
 model/web/error.go                   |  64 -------------
 model/web/error_code.go              |  12 ---
 provider/di.go                       |  16 ----
 provider/mail/queue.go               | 101 --------------------
 provider/mail/smtp/smtp.go           |  44 ---------
 provider/mail/type.go                |  19 ----
 repository/user/type.go              |   1 -
 repository/user/user.go              |  26 +----
 routes/auth/route.go                 |   1 -
 service/auth/impl.go                 |   4 +-
 service/auth/login.go                |  16 ++--
 service/auth/refresh.go              |   5 +-
 service/auth/register.go             |  22 -----
 service/auth/type.go                 |   2 -
 service/di.go                        |   9 +-
 service/reporter/logtail.go          |  17 +---
 service/verification/impl.go         |  11 ---
 service/verification/send.go         |   6 --
 service/verification/type.go         |   6 --
 service/verification/verify.go       |   6 --
 test/api.go                          |  11 ---
 test/db/di.go                        |  11 ---
 test/db/mock.go                      |  32 -------
 test/di.go                           |  11 +--
 test/utils/base.go                   |   7 +-
 test/utils/executor.go               |  31 +-----
 test/utils/password/password_test.go |  18 +---
 test/utils/token/token_test.go       |  77 ---------------
 utils/app/app.go                     |   4 -
 utils/app/start.go                   |   1 -
 utils/db/database.go                 |  34 +++----
 utils/di.go                          |  10 +-
 utils/env/env.go                     |   9 --
 utils/password/impl.go               |   4 +-
 utils/token/impl.go                  |  22 ++---
 utils/token/type.go                  |   4 +-
 53 files changed, 103 insertions(+), 1251 deletions(-)
 delete mode 100644 .vscode/launch.json
 delete mode 100644 handler/auth/register.go
 delete mode 100644 model/web/auth/register/request.go
 delete mode 100644 model/web/error.go
 delete mode 100644 model/web/error_code.go
 delete mode 100644 provider/di.go
 delete mode 100644 provider/mail/queue.go
 delete mode 100644 provider/mail/smtp/smtp.go
 delete mode 100644 provider/mail/type.go
 delete mode 100644 service/auth/register.go
 delete mode 100644 service/verification/impl.go
 delete mode 100644 service/verification/send.go
 delete mode 100644 service/verification/type.go
 delete mode 100644 service/verification/verify.go
 delete mode 100644 test/api.go
 delete mode 100644 test/db/di.go
 delete mode 100644 test/db/mock.go
 delete mode 100644 test/utils/token/token_test.go

diff --git a/.env b/.env
index 1f5f0f1..992d133 100644
--- a/.env
+++ b/.env
@@ -3,8 +3,4 @@ LISTEN_ADDR=0.0.0.0
 PORT=8080
 LOGTAIL_TOKEN=
 HTTP_TIMEOUT_SEC=2
-LOG_FLUSH_INTERVAL_MS=1000
-DB_STRING="host=localhost user=ocw password=ocw dbname=ocw-db port=5433 sslmode=disable TimeZone=Asia/Shanghai"
-SMTP_USERNAME="noreply@ocw.id"
-SMTP_SERVER=localhost
-SMTP_PORT=1025
\ No newline at end of file
+LOG_FLUSH_INTERVAL_MS=1000
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
deleted file mode 100644
index afb1b51..0000000
--- a/.vscode/launch.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-  // Use IntelliSense to learn about possible attributes.
-  // Hover to view descriptions of existing attributes.
-  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
-  "version": "0.2.0",
-  "configurations": [
-    {
-      "name": "Launch Package",
-      "type": "go",
-      "request": "launch",
-      "mode": "auto",
-      "program": "${workspaceFolder}"
-    }
-  ]
-}
diff --git a/README.md b/README.md
index a22908f..0975036 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# ITBOpenCourseWare Backend
+# OCW Backend
 
 Repository ini adalah repository untuk OCW Backend
 
@@ -11,10 +11,9 @@ Ini adalah requirement untuk menjalankan template ini:
 3. Postgresql (Optional, when using docker)
 4. GNU Make 4.3 (Optional, when using docker)
 5. Minio (Optional, when using docker)
-6. Google wire v0.5.0 (<https://github.com/google/wire>) [MANDATORY]
-7. swaggo (<https://github.com/swaggo/swag>)
-8. Air command line (<https://github.com/cosmtrek/air>)
-9. Redis
+6. Google wire v0.5.0 (https://github.com/google/wire) [MANDATORY]
+7. Air command line (https://github.com/cosmtrek/air)
+8. Redis
 
 ## Cara menjalankan
 
@@ -23,66 +22,3 @@ Untuk menjalankan server ini, gunakan:
 ```sh
 make watch
 ```
-
-## Development Guide
-
-1. Checkout ke branch staging + pull
-
-   ```sh
-   git checkout staging
-   git pull
-   ```
-
-2. Buat branch baru dari staging dengan format `feat/s<nomor sprint>-sb<nomor sb>-<nama fitur dipisah dengan strip (-)>`. Jika membuat perubahan dari fitur yang sudah ada di staging, formatnya menjadi `fix/s<nomor sprint>-sb<nomor sb>-<apa yang diubah dari fitur tersebut>`
-
-   ```sh
-   git checkout -b feat/s1-sb1-login
-   ```
-
-3. Lakukan perubahan pada branch tersebut, commit dengan format `feat(<scope fitur>): <isi perubahan>`. Jika melakukan perubahan pada fitur yang sudah ada, formatnya menjadi `fix(<scope fitur>): <isi perubahan>`, lain-lainnya bisa dilihat di [semantic commit](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716)
-
-   ```sh
-   git commit -m "feat(login): add login page"
-   ```
-
-4. Push branch ke remote
-
-   ```sh
-   git push origin feat/s1-sb1-login
-   ```
-
-5. Buat merge request ke branch staging, tambah assignee diri sendiri dan reviewer
-
-### Handling Accidents
-
-- Salah branch untuk commit?
-
-  Gunakan `git reset --soft HEAD~1` untuk menghapus commit terakhir, lalu `git checkout <branch yang benar>` untuk kembali ke branch yang benar. Commit ulang dengan format yang benar. Tapi hal ini hanya bisa dilakukan sebelum push ke remote.
-
-  Baru sadar salah branch setelah beberapa commit? Gunakan `git reset --soft HEAD~<jumlah commit sebelumnya>`
-
-- Ada update baru dari staging ketika sedang mengerjakan pekerjaan di branch sendiri?
-
-  Sebenarnya jika itu pekerjaan orang yang tidak ada hubungannya dengan anda, tidak masalah.
-  
-  Tapi jika iya, contohnya ingin mengambil komponen yang baru ada di staging, gunakan `git rebase staging` untuk mengambil update dari staging. Jika ada konflik, selesaikan konflik tersebut, lalu `git add .` dan `git rebase --continue` untuk melanjutkan rebase. Jika sudah selesai, push ulang branch anda ke remote dengan `git push -f`.
-
-   Sistem kerja rebase *basically* memutuskan semua commit pekerjaan anda sampai commit terakhir yang sinkron dengan staging, git pull dari staging, lalu menyambungkan kembali sehingga dapat meminimalisir konflik, walaupun tetap bisa ada konflik, terutama jika ada perubahan di file sama. Selengkapnya bisa dilihat ilustrasinya sebagai berikut.
-
-   ![rebase illustration](https://www.blog.duomly.com/wp-content/uploads/2020/05/Rebase.png)
-
-- Ada konflik saat melakukan rebase?
-
-  Selesaikan konflik tersebut, lalu `git add .` dan `git rebase --continue` untuk melanjutkan rebase. Jika sudah selesai, push ulang branch anda ke remote dengan `git push -f`.
-
-- Ada konflik saat melakukan merge request?
-
-  Selesaikan konflik tersebut, lalu `git add .` dan `git commit --amend` untuk menggabungkan konflik tersebut ke commit terakhir (jika malas). Push ulang branch anda ke remote dengan `git push -f`.
-
-- Ada salah di pesan commit terakhir?
-
-  Gunakan `git commit --amend` untuk mengganti commit terakhir dengan commit baru. Jika sudah selesai, push ulang branch anda ke remote dengan `git push -f`.
-
-- Baru sadar ada salah pesan di beberapa commit sebelumnya?
-
-  Gunakan `git rebase -i HEAD~<jumlah commit sebelumnya>` untuk mengubah pesan commit dari commit terakhir hingga beberapa sebelumnya. Jika sudah selesai, push ulang branch anda ke remote dengan `git push -f`.
diff --git a/di.go b/di.go
index 66bbf65..25590b9 100644
--- a/di.go
+++ b/di.go
@@ -8,8 +8,6 @@ import (
 
 	"gitlab.informatika.org/ocw/ocw-backend/handler"
 	"gitlab.informatika.org/ocw/ocw-backend/middleware"
-	"gitlab.informatika.org/ocw/ocw-backend/provider"
-	"gitlab.informatika.org/ocw/ocw-backend/repository"
 	"gitlab.informatika.org/ocw/ocw-backend/routes"
 	"gitlab.informatika.org/ocw/ocw-backend/service"
 	"gitlab.informatika.org/ocw/ocw-backend/utils"
@@ -20,12 +18,10 @@ import (
 func CreateServer() (app.Server, error) {
 	wire.Build(
 		utils.UtilSet,
-		repository.RepositorySet,
 		handler.HandlerSet,
 		middleware.MiddlewareSet,
 		routes.RoutesSet,
 		service.ServiceSet,
-		provider.ProviderSet,
 	)
 
 	return nil, nil
diff --git a/docs/docs.go b/docs/docs.go
index 90d0363..a98b111 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -61,7 +61,7 @@ const docTemplate = `{
                 ],
                 "responses": {
                     "200": {
-                        "description": "Login Success",
+                        "description": "OK",
                         "schema": {
                             "allOf": [
                                 {
@@ -78,47 +78,8 @@ const docTemplate = `{
                             ]
                         }
                     },
-                    "400": {
-                        "description": "Bad Input",
-                        "schema": {
-                            "allOf": [
-                                {
-                                    "$ref": "#/definitions/web.BaseResponse"
-                                },
-                                {
-                                    "type": "object",
-                                    "properties": {
-                                        "data": {
-                                            "type": "array",
-                                            "items": {
-                                                "type": "string"
-                                            }
-                                        }
-                                    }
-                                }
-                            ]
-                        }
-                    },
                     "403": {
-                        "description": "Login Credential Error",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "415": {
-                        "description": "Not a json request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "422": {
-                        "description": "Invalid JSON input",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Unknown Internal Error",
+                        "description": "Forbidden",
                         "schema": {
                             "$ref": "#/definitions/web.BaseResponse"
                         }
@@ -167,66 +128,8 @@ const docTemplate = `{
                             ]
                         }
                     },
-                    "400": {
-                        "description": "Bad Request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "401": {
-                        "description": "Unauthorized",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Internal Server Error",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    }
-                }
-            }
-        },
-        "/auth/register": {
-            "post": {
-                "description": "Generate New Account as Member",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "auth"
-                ],
-                "summary": "Register New Account",
-                "parameters": [
-                    {
-                        "description": "Register Payload",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/register.RegisterRequestPayload"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "400": {
-                        "description": "Bad Request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Internal Server Error",
+                    "403": {
+                        "description": "Forbidden",
                         "schema": {
                             "$ref": "#/definitions/web.BaseResponse"
                         }
@@ -280,38 +183,6 @@ const docTemplate = `{
                 }
             }
         },
-        "register.RegisterRequestPayload": {
-            "description": "Information that should be available when do a registration process",
-            "type": "object",
-            "required": [
-                "email",
-                "name",
-                "password",
-                "password_validation"
-            ],
-            "properties": {
-                "email": {
-                    "description": "User Email",
-                    "type": "string",
-                    "example": "someone@example.com"
-                },
-                "name": {
-                    "description": "User name",
-                    "type": "string",
-                    "example": "someone"
-                },
-                "password": {
-                    "description": "User Password",
-                    "type": "string",
-                    "example": "secret"
-                },
-                "password_validation": {
-                    "description": "User Password Validation, must be same as user",
-                    "type": "string",
-                    "example": "secret"
-                }
-            }
-        },
         "web.BaseResponse": {
             "type": "object",
             "properties": {
diff --git a/docs/swagger.json b/docs/swagger.json
index dc9d78a..442fa43 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -53,7 +53,7 @@
                 ],
                 "responses": {
                     "200": {
-                        "description": "Login Success",
+                        "description": "OK",
                         "schema": {
                             "allOf": [
                                 {
@@ -70,47 +70,8 @@
                             ]
                         }
                     },
-                    "400": {
-                        "description": "Bad Input",
-                        "schema": {
-                            "allOf": [
-                                {
-                                    "$ref": "#/definitions/web.BaseResponse"
-                                },
-                                {
-                                    "type": "object",
-                                    "properties": {
-                                        "data": {
-                                            "type": "array",
-                                            "items": {
-                                                "type": "string"
-                                            }
-                                        }
-                                    }
-                                }
-                            ]
-                        }
-                    },
                     "403": {
-                        "description": "Login Credential Error",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "415": {
-                        "description": "Not a json request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "422": {
-                        "description": "Invalid JSON input",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Unknown Internal Error",
+                        "description": "Forbidden",
                         "schema": {
                             "$ref": "#/definitions/web.BaseResponse"
                         }
@@ -159,66 +120,8 @@
                             ]
                         }
                     },
-                    "400": {
-                        "description": "Bad Request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "401": {
-                        "description": "Unauthorized",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Internal Server Error",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    }
-                }
-            }
-        },
-        "/auth/register": {
-            "post": {
-                "description": "Generate New Account as Member",
-                "consumes": [
-                    "application/json"
-                ],
-                "produces": [
-                    "application/json"
-                ],
-                "tags": [
-                    "auth"
-                ],
-                "summary": "Register New Account",
-                "parameters": [
-                    {
-                        "description": "Register Payload",
-                        "name": "data",
-                        "in": "body",
-                        "required": true,
-                        "schema": {
-                            "$ref": "#/definitions/register.RegisterRequestPayload"
-                        }
-                    }
-                ],
-                "responses": {
-                    "200": {
-                        "description": "OK",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "400": {
-                        "description": "Bad Request",
-                        "schema": {
-                            "$ref": "#/definitions/web.BaseResponse"
-                        }
-                    },
-                    "500": {
-                        "description": "Internal Server Error",
+                    "403": {
+                        "description": "Forbidden",
                         "schema": {
                             "$ref": "#/definitions/web.BaseResponse"
                         }
@@ -272,38 +175,6 @@
                 }
             }
         },
-        "register.RegisterRequestPayload": {
-            "description": "Information that should be available when do a registration process",
-            "type": "object",
-            "required": [
-                "email",
-                "name",
-                "password",
-                "password_validation"
-            ],
-            "properties": {
-                "email": {
-                    "description": "User Email",
-                    "type": "string",
-                    "example": "someone@example.com"
-                },
-                "name": {
-                    "description": "User name",
-                    "type": "string",
-                    "example": "someone"
-                },
-                "password": {
-                    "description": "User Password",
-                    "type": "string",
-                    "example": "secret"
-                },
-                "password_validation": {
-                    "description": "User Password Validation, must be same as user",
-                    "type": "string",
-                    "example": "secret"
-                }
-            }
-        },
         "web.BaseResponse": {
             "type": "object",
             "properties": {
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 9c74543..f21c315 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -31,31 +31,6 @@ definitions:
         description: Token that used to access the resources
         type: string
     type: object
-  register.RegisterRequestPayload:
-    description: Information that should be available when do a registration process
-    properties:
-      email:
-        description: User Email
-        example: someone@example.com
-        type: string
-      name:
-        description: User name
-        example: someone
-        type: string
-      password:
-        description: User Password
-        example: secret
-        type: string
-      password_validation:
-        description: User Password Validation, must be same as user
-        example: secret
-        type: string
-    required:
-    - email
-    - name
-    - password
-    - password_validation
-    type: object
   web.BaseResponse:
     properties:
       data: {}
@@ -102,7 +77,7 @@ paths:
       - application/json
       responses:
         "200":
-          description: Login Success
+          description: OK
           schema:
             allOf:
             - $ref: '#/definitions/web.BaseResponse'
@@ -110,31 +85,8 @@ paths:
                 data:
                   $ref: '#/definitions/login.LoginResponsePayload'
               type: object
-        "400":
-          description: Bad Input
-          schema:
-            allOf:
-            - $ref: '#/definitions/web.BaseResponse'
-            - properties:
-                data:
-                  items:
-                    type: string
-                  type: array
-              type: object
         "403":
-          description: Login Credential Error
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "415":
-          description: Not a json request
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "422":
-          description: Invalid JSON input
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "500":
-          description: Unknown Internal Error
+          description: Forbidden
           schema:
             $ref: '#/definitions/web.BaseResponse'
       summary: Login
@@ -163,49 +115,11 @@ paths:
                 data:
                   $ref: '#/definitions/refresh.RefreshResponsePayload'
               type: object
-        "400":
-          description: Bad Request
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "401":
-          description: Unauthorized
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "500":
-          description: Internal Server Error
+        "403":
+          description: Forbidden
           schema:
             $ref: '#/definitions/web.BaseResponse'
       summary: Refresh Token
       tags:
       - auth
-  /auth/register:
-    post:
-      consumes:
-      - application/json
-      description: Generate New Account as Member
-      parameters:
-      - description: Register Payload
-        in: body
-        name: data
-        required: true
-        schema:
-          $ref: '#/definitions/register.RegisterRequestPayload'
-      produces:
-      - application/json
-      responses:
-        "200":
-          description: OK
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "400":
-          description: Bad Request
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-        "500":
-          description: Internal Server Error
-          schema:
-            $ref: '#/definitions/web.BaseResponse'
-      summary: Register New Account
-      tags:
-      - auth
 swagger: "2.0"
diff --git a/go.mod b/go.mod
index b69d320..e4ec072 100644
--- a/go.mod
+++ b/go.mod
@@ -6,17 +6,12 @@ require (
 	github.com/caarlos0/env/v6 v6.10.1
 	github.com/go-chi/chi/v5 v5.0.8
 	github.com/go-chi/cors v1.2.1
-	github.com/go-playground/validator/v10 v10.11.2
-	github.com/golang-jwt/jwt/v4 v4.4.3
 	github.com/google/wire v0.5.0
 	github.com/joho/godotenv v1.5.0
 	github.com/sirupsen/logrus v1.9.0
 	github.com/stretchr/testify v1.8.1
 	github.com/swaggo/http-swagger v1.3.3
 	github.com/swaggo/swag v1.8.10
-	golang.org/x/crypto v0.6.0
-	gorm.io/driver/postgres v1.4.6
-	gorm.io/gorm v1.24.5
 )
 
 require (
@@ -24,17 +19,15 @@ require (
 	github.com/KyleBanks/depth v1.2.1 // indirect
 	github.com/PuerkitoBio/purell v1.1.1 // indirect
 	github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
-	github.com/cosmtrek/air v1.41.0 // indirect
-	github.com/creack/pty v1.1.18 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
-	github.com/fatih/color v1.14.1 // indirect
-	github.com/fsnotify/fsnotify v1.6.0 // indirect
 	github.com/go-openapi/jsonpointer v0.19.6 // indirect
 	github.com/go-openapi/jsonreference v0.20.2 // indirect
 	github.com/go-openapi/spec v0.20.8 // indirect
 	github.com/go-openapi/swag v0.22.3 // indirect
 	github.com/go-playground/locales v0.14.1 // indirect
 	github.com/go-playground/universal-translator v0.18.1 // indirect
+	github.com/go-playground/validator/v10 v10.11.2 // indirect
+	github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
 	github.com/jackc/pgpassfile v1.0.0 // indirect
 	github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
 	github.com/jackc/pgx/v5 v5.2.0 // indirect
@@ -43,16 +36,16 @@ require (
 	github.com/josharian/intern v1.0.0 // indirect
 	github.com/leodido/go-urn v1.2.1 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect
-	github.com/mattn/go-colorable v0.1.13 // indirect
-	github.com/mattn/go-isatty v0.0.17 // indirect
-	github.com/pelletier/go-toml v1.9.5 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/stretchr/objx v0.5.0 // indirect
 	github.com/swaggo/files v1.0.0 // indirect
+	golang.org/x/crypto v0.6.0 // indirect
 	golang.org/x/net v0.6.0 // indirect
 	golang.org/x/sys v0.5.0 // indirect
 	golang.org/x/text v0.7.0 // indirect
 	golang.org/x/tools v0.5.0 // indirect
 	gopkg.in/yaml.v2 v2.4.0 // indirect
 	gopkg.in/yaml.v3 v3.0.1 // indirect
+	gorm.io/driver/postgres v1.4.6 // indirect
+	gorm.io/gorm v1.24.5 // indirect
 )
diff --git a/go.sum b/go.sum
index d771a87..db1952c 100644
--- a/go.sum
+++ b/go.sum
@@ -8,18 +8,10 @@ github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
 github.com/caarlos0/env/v6 v6.10.1 h1:t1mPSxNpei6M5yAeu1qtRdPAK29Nbcf/n3G7x+b3/II=
 github.com/caarlos0/env/v6 v6.10.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5Zu0ddvwc=
-github.com/cosmtrek/air v1.41.0 h1:6ck2LbcVvby6cyuwE8ruia41U2nppMZGWOpq+E/EhoU=
-github.com/cosmtrek/air v1.41.0/go.mod h1:+RBGjJt7T2f3I7td8Tvk0XsH/hZ3E1QBLfiWObICO4c=
 github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
-github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
-github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
-github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
-github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
-github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
 github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=
 github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
 github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4=
@@ -55,8 +47,6 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
 github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
 github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8=
 github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU=
-github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
-github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
 github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
 github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
 github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E=
@@ -90,14 +80,7 @@ github.com/mailru/easyjson v0.7.6 h1:8yTIVnZgCoiM1TgqoeTl+LfU5Jg6/xL3QhGQnimLYnA
 github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
 github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
 github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
-github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
-github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
-github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
-github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
-github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
 github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
-github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
@@ -157,8 +140,6 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
 golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
 golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
@@ -199,7 +180,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gorm.io/driver/postgres v1.4.6 h1:1FPESNXqIKG5JmraaH2bfCVlMQ7paLoCreFxDtqzwdc=
diff --git a/handler/auth/handler.go b/handler/auth/handler.go
index adae847..6a8f65b 100644
--- a/handler/auth/handler.go
+++ b/handler/auth/handler.go
@@ -2,7 +2,6 @@ package auth
 
 import (
 	"gitlab.informatika.org/ocw/ocw-backend/service/auth"
-	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/httputil"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/wrapper"
 )
@@ -11,5 +10,4 @@ type AuthHandlerImpl struct {
 	auth.AuthService
 	httputil.HttpUtil
 	wrapper.WrapperUtil
-	logger.Logger
 }
diff --git a/handler/auth/login.go b/handler/auth/login.go
index 3ab6f07..ee72964 100644
--- a/handler/auth/login.go
+++ b/handler/auth/login.go
@@ -1,11 +1,9 @@
 package auth
 
 import (
-	"fmt"
 	"net/http"
 
 	"github.com/go-playground/validator/v10"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/login"
 )
 
@@ -17,26 +15,16 @@ import (
 //		@Produce			json
 //		@Accept				json
 //		@Param				data body login.LoginRequestPayload true "Login payload"
-//		@Success			200	{object}	web.BaseResponse{data=login.LoginResponsePayload} "Login Success"
-//	  @Failure			400 {object}  web.BaseResponse{data=[]string} "Bad Input"
-//	  @Failure			403 {object}  web.BaseResponse "Login Credential Error"
-//	  @Failure			415 {object}  web.BaseResponse "Not a json request"
-//	  @Failure			422 {object}  web.BaseResponse "Invalid JSON input"
-//	  @Failure			500 {object}  web.BaseResponse "Unknown Internal Error"
+//		@Success			200	{object}	web.BaseResponse{data=login.LoginResponsePayload}
+//	  @Failure			403 {object}  web.BaseResponse
 //		@Router				/auth/login [post]
 func (a AuthHandlerImpl) Login(w http.ResponseWriter, r *http.Request) {
 	payload := login.LoginRequestPayload{}
 	validate := validator.New()
 
-	if r.Header.Get("Content-Type") != "application/json" {
-		payload := a.WrapperUtil.ErrorResponseWrap("this service only receive json input", nil)
-		a.HttpUtil.WriteJson(w, http.StatusUnsupportedMediaType, payload)
-		return
-	}
-
 	if err := a.HttpUtil.ParseJson(r, &payload); err != nil {
-		payload := a.WrapperUtil.ErrorResponseWrap("invalid json input", err.Error())
-		a.HttpUtil.WriteJson(w, http.StatusUnprocessableEntity, payload)
+		payload := a.WrapperUtil.ErrorResponseWrap(err.Error(), nil)
+		a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
 		return
 	}
 
@@ -47,8 +35,12 @@ func (a AuthHandlerImpl) Login(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-		errPayload := web.NewResponseErrorFromValidator(err.(validator.ValidationErrors))
-		payload := a.WrapperUtil.ErrorResponseWrap(errPayload.Error(), errPayload)
+		errList := []string{}
+		for _, err := range err.(validator.ValidationErrors) {
+			errList = append(errList, err.Error())
+		}
+
+		payload := a.WrapperUtil.ErrorResponseWrap("input validation error", errList)
 		a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
 		return
 	}
@@ -56,22 +48,8 @@ func (a AuthHandlerImpl) Login(w http.ResponseWriter, r *http.Request) {
 	response, err := a.AuthService.Login(payload)
 
 	if err != nil {
-		respErr, ok := err.(web.ResponseError)
-		if ok {
-			payload := a.WrapperUtil.ErrorResponseWrap(respErr.Error(), respErr)
-
-			if respErr.Code != web.InvalidLogin {
-				a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
-			} else {
-				a.HttpUtil.WriteJson(w, http.StatusForbidden, payload)
-			}
-		} else {
-			a.Logger.Error(
-				fmt.Sprintf("[AUTH] some error happened when do login: %s", err.Error()),
-			)
-			payload := a.WrapperUtil.ErrorResponseWrap("internal server error", nil)
-			a.HttpUtil.WriteJson(w, http.StatusInternalServerError, payload)
-		}
+		payload := a.WrapperUtil.ErrorResponseWrap(err.Error(), nil)
+		a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
 		return
 	}
 
diff --git a/handler/auth/refresh.go b/handler/auth/refresh.go
index 20eaed5..bf8fda2 100644
--- a/handler/auth/refresh.go
+++ b/handler/auth/refresh.go
@@ -1,11 +1,9 @@
 package auth
 
 import (
-	"fmt"
 	"net/http"
 	"strings"
 
-	"gitlab.informatika.org/ocw/ocw-backend/model/web"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/refresh"
 )
 
@@ -18,9 +16,7 @@ import (
 //		@Accept				json
 //		@Param				Authorization header string true "Refresh token"
 //		@Success			200	{object}	web.BaseResponse{data=refresh.RefreshResponsePayload}
-//	  @Failure			400 {object}  web.BaseResponse
-//	  @Failure			401 {object}  web.BaseResponse
-//	  @Failure			500 {object}  web.BaseResponse
+//	  @Failure			403 {object}  web.BaseResponse
 //		@Router				/auth/refresh [post]
 func (a AuthHandlerImpl) Refresh(w http.ResponseWriter, r *http.Request) {
 	payload := refresh.RefreshRequestPayload{}
@@ -51,17 +47,8 @@ func (a AuthHandlerImpl) Refresh(w http.ResponseWriter, r *http.Request) {
 	response, err := a.AuthService.Refresh(payload)
 
 	if err != nil {
-		if errData, ok := err.(web.ResponseError); ok {
-			payload := a.WrapperUtil.ErrorResponseWrap(errData.Error(), errData)
-			a.HttpUtil.WriteJson(w, http.StatusUnauthorized, payload)
-			return
-		}
-
-		a.Logger.Error(
-			fmt.Sprintf("[AUTH] some error happened when do refresh: %s", err.Error()),
-		)
-		payload := a.WrapperUtil.ErrorResponseWrap("internal server error", nil)
-		a.HttpUtil.WriteJson(w, http.StatusInternalServerError, payload)
+		payload := a.WrapperUtil.ErrorResponseWrap(err.Error(), nil)
+		a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
 		return
 	}
 
diff --git a/handler/auth/register.go b/handler/auth/register.go
deleted file mode 100644
index 8a24f5d..0000000
--- a/handler/auth/register.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package auth
-
-import (
-	"fmt"
-	"net/http"
-	"strings"
-
-	"github.com/go-playground/validator/v10"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/register"
-)
-
-// Index godoc
-//
-//		@Tags					auth
-//		@Summary			Register New Account
-//		@Description	Generate New Account as Member
-//		@Produce			json
-//		@Accept				json
-//		@Param				data body register.RegisterRequestPayload true "Register Payload"
-//		@Success			200	{object}	web.BaseResponse
-//	  @Failure			400 {object}  web.BaseResponse
-//	  @Failure			500 {object}  web.BaseResponse
-//		@Router				/auth/register [post]
-func (a AuthHandlerImpl) Register(w http.ResponseWriter, r *http.Request) {
-	payload := register.RegisterRequestPayload{}
-	validate := validator.New()
-
-	if r.Header.Get("Content-Type") != "application/json" {
-		payload := a.WrapperUtil.ErrorResponseWrap("this service only receive json input", nil)
-		a.HttpUtil.WriteJson(w, http.StatusUnsupportedMediaType, payload)
-		return
-	}
-
-	if err := a.HttpUtil.ParseJson(r, &payload); err != nil {
-		payload := a.WrapperUtil.ErrorResponseWrap("invalid json input", err.Error())
-		a.HttpUtil.WriteJson(w, http.StatusUnprocessableEntity, payload)
-		return
-	}
-
-	if err := validate.Struct(payload); err != nil {
-		if _, ok := err.(*validator.InvalidValidationError); ok {
-			payload := a.WrapperUtil.ErrorResponseWrap(err.Error(), nil)
-			a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
-			return
-		}
-
-		errPayload := web.NewResponseErrorFromValidator(err.(validator.ValidationErrors))
-		payload := a.WrapperUtil.ErrorResponseWrap(errPayload.Error(), errPayload)
-		a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
-		return
-	}
-
-	err := a.AuthService.Register(payload)
-
-	if err != nil {
-		if strings.Contains(err.Error(), "duplicate key") {
-			err = web.NewResponseErrorFromError(err, web.EmailExist)
-		}
-
-		respErr, ok := err.(web.ResponseError)
-		if ok {
-			payload := a.WrapperUtil.ErrorResponseWrap("email was registered by other account", respErr)
-			a.HttpUtil.WriteJson(w, http.StatusBadRequest, payload)
-		} else {
-			a.Logger.Error(
-				fmt.Sprintf("[AUTH] some error happened when do register: %s", err.Error()),
-			)
-			payload := a.WrapperUtil.ErrorResponseWrap("internal server error", nil)
-			a.HttpUtil.WriteJson(w, http.StatusInternalServerError, payload)
-		}
-		return
-	}
-
-	responsePayload := a.WrapperUtil.SuccessResponseWrap(nil)
-	a.HttpUtil.WriteSuccessJson(w, responsePayload)
-}
diff --git a/handler/auth/types.go b/handler/auth/types.go
index 71b4d1e..49aa52c 100644
--- a/handler/auth/types.go
+++ b/handler/auth/types.go
@@ -4,6 +4,5 @@ import "net/http"
 
 type AuthHandler interface {
 	Login(w http.ResponseWriter, r *http.Request)
-	Register(w http.ResponseWriter, r *http.Request)
 	Refresh(w http.ResponseWriter, r *http.Request)
 }
diff --git a/model/domain/user/role.go b/model/domain/user/role.go
index 0b036ee..25e8bd6 100644
--- a/model/domain/user/role.go
+++ b/model/domain/user/role.go
@@ -11,18 +11,18 @@ type UserRole int
 
 const (
 	Admin UserRole = iota
-	Student
+	Member
 	Contributor
 )
 
 var roleMapping = map[UserRole]string{
 	Admin:       "admin",
-	Student:     "student",
+	Member:      "member",
 	Contributor: "contributor",
 }
 
 func (ur *UserRole) Scan(value interface{}) error {
-	val := value.(string)
+	val := string(value.([]byte))
 
 	for key, label := range roleMapping {
 		if label == val {
diff --git a/model/domain/user/user.go b/model/domain/user/user.go
index f2fbb56..62d5e1e 100644
--- a/model/domain/user/user.go
+++ b/model/domain/user/user.go
@@ -1,17 +1,11 @@
 package user
 
-import "time"
-
 type User struct {
 	Email       string `gorm:"primaryKey"`
 	Password    string
 	Name        string
 	Role        UserRole `gorm:"type:user_role"`
 	IsActivated bool
-	CreatedAt   time.Time
-	UpdatedAt   time.Time
-}
-
-func (User) TableName() string {
-	return "user"
+	CreatedAt   int64 `gorm:"autoCreateTime:nano"`
+	UpdatedAt   int64 `gorm:"autoUpdateTime:nano"`
 }
diff --git a/model/web/auth/register/request.go b/model/web/auth/register/request.go
deleted file mode 100644
index 48d5810..0000000
--- a/model/web/auth/register/request.go
+++ /dev/null
@@ -1,17 +0,0 @@
-package register
-
-// Register Request Payload
-// @Description Information that should be available when do a registration process
-type RegisterRequestPayload struct {
-	// User Email
-	Email string `json:"email" validate:"required,email" example:"someone@example.com"`
-
-	// User Password
-	Password string `json:"password" validate:"required" example:"secret"`
-
-	// User Password Validation, must be same as user
-	PasswordValidation string `json:"password_validation" validate:"required,eqfield=Password" example:"secret"`
-
-	// User name
-	Name string `json:"name" validate:"required" example:"someone"`
-}
diff --git a/model/web/error.go b/model/web/error.go
deleted file mode 100644
index 2ef0606..0000000
--- a/model/web/error.go
+++ /dev/null
@@ -1,64 +0,0 @@
-package web
-
-import (
-	"fmt"
-
-	"github.com/go-playground/validator/v10"
-)
-
-type ResponseError struct {
-	Message string      `json:"-"`
-	Code    string      `json:"code"`
-	Details interface{} `json:"details"`
-}
-
-func (v ResponseError) Error() string {
-	return v.Message
-}
-
-func NewResponseError(
-	message string,
-	code string,
-) ResponseError {
-	return ResponseError{
-		Message: message,
-		Code:    code,
-		Details: []string{},
-	}
-}
-
-func NewResponseErrorFromError(
-	err error,
-	code string,
-) ResponseError {
-	return NewResponseError(err.Error(), code)
-}
-
-func NewResponseErrorFromValidator(
-	err validator.ValidationErrors,
-) ResponseError {
-	errList := []map[string]string{}
-	for _, err := range err {
-		errList = append(errList, map[string]string{
-			"field": err.Field(),
-			"tag":   err.Tag(),
-		})
-	}
-
-	return ResponseError{
-		Message: "input is not valid",
-		Code:    InvalidInput,
-		Details: errList,
-	}
-}
-
-func NewResponseErrorf(
-	code string,
-	format string,
-	value ...interface{},
-) ResponseError {
-	return NewResponseErrorFromError(
-		fmt.Errorf(format, value...),
-		code,
-	)
-}
diff --git a/model/web/error_code.go b/model/web/error_code.go
deleted file mode 100644
index 0999a12..0000000
--- a/model/web/error_code.go
+++ /dev/null
@@ -1,12 +0,0 @@
-package web
-
-const (
-	InvalidInput string = "INVALID_INPUT"
-
-	InvalidLogin       string = "INVALID_LOGIN"
-	UnauthorizedAccess string = "UNAUTHORIZED"
-	InactiveUser       string = "INACTIVE_ACCOUNT"
-	EmailExist         string = "EMAIL_EXIST"
-
-	TokenError string = "TOKEN_ERROR"
-)
diff --git a/provider/di.go b/provider/di.go
deleted file mode 100644
index f1ffaae..0000000
--- a/provider/di.go
+++ /dev/null
@@ -1,16 +0,0 @@
-package provider
-
-import (
-	"github.com/google/wire"
-	"gitlab.informatika.org/ocw/ocw-backend/provider/mail"
-	"gitlab.informatika.org/ocw/ocw-backend/provider/mail/smtp"
-)
-
-var ProviderSet = wire.NewSet(
-	// Provider
-	smtp.New,
-	mail.NewQueue,
-
-	wire.Bind(new(mail.MailQueue), new(*mail.MailQueueImpl)),
-	wire.Bind(new(mail.MailProvider), new(*smtp.SmtpMailProvider)),
-)
diff --git a/provider/mail/queue.go b/provider/mail/queue.go
deleted file mode 100644
index 84acd68..0000000
--- a/provider/mail/queue.go
+++ /dev/null
@@ -1,101 +0,0 @@
-package mail
-
-import (
-	"context"
-	"fmt"
-	"sync"
-	"time"
-
-	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
-)
-
-type MailQueueImpl struct {
-	provider  MailProvider
-	queue     []Mail
-	mutex     sync.Mutex
-	logUtil   logger.Logger
-	env       *env.Environment
-	isStarted bool
-}
-
-func NewQueue(
-	provider MailProvider,
-	log logger.Logger,
-	env *env.Environment,
-) *MailQueueImpl {
-	return &MailQueueImpl{
-		provider:  provider,
-		queue:     []Mail{},
-		mutex:     sync.Mutex{},
-		logUtil:   log,
-		isStarted: false,
-		env:       env,
-	}
-}
-
-func (mq *MailQueueImpl) Send(mail Mail) {
-	if !mq.isStarted {
-		return
-	}
-
-	mq.mutex.Lock()
-	defer mq.mutex.Unlock()
-
-	mq.queue = append(mq.queue, mail)
-}
-
-func (mq *MailQueueImpl) Flush() {
-	mq.mutex.Lock()
-	defer mq.mutex.Unlock()
-
-	if len(mq.queue) == 0 {
-		return
-	}
-
-	sendBuffer := make([]Mail, len(mq.queue))
-	copy(sendBuffer, mq.queue)
-
-	go func(buffer *[]Mail) {
-		for _, data := range *buffer {
-			err := mq.provider.Send(data.To, data.Subject, data.Message)
-
-			if err != nil {
-				mq.logUtil.Error(
-					fmt.Sprintf("Problem with sending mail: %s", err.Error()),
-				)
-			}
-		}
-	}(&sendBuffer)
-
-	mq.queue = []Mail{}
-}
-
-func (mq *MailQueueImpl) Start(ctx context.Context) {
-	go func() {
-		mq.isStarted = true
-		defer func() {
-			mq.isStarted = false
-			mq.logUtil.Info("🛑 Mail queue has been stopped.")
-		}()
-
-		interval := time.Duration(mq.env.MailingInterval)
-		timer := time.NewTicker(interval * time.Millisecond)
-		defer timer.Stop()
-
-		mq.logUtil.Info(
-			fmt.Sprintf("Mailing started to listen... (interval: %dms)", interval),
-		)
-
-		isLoop := true
-
-		for isLoop {
-			select {
-			case <-ctx.Done():
-				isLoop = false
-			case <-timer.C:
-				mq.Flush()
-			}
-		}
-	}()
-}
diff --git a/provider/mail/smtp/smtp.go b/provider/mail/smtp/smtp.go
deleted file mode 100644
index dd2873a..0000000
--- a/provider/mail/smtp/smtp.go
+++ /dev/null
@@ -1,44 +0,0 @@
-package smtp
-
-import (
-	"fmt"
-	"net/smtp"
-
-	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
-)
-
-type SmtpMailProvider struct {
-	*env.Environment
-	smtp.Auth
-}
-
-func New(env *env.Environment) *SmtpMailProvider {
-	auth := smtp.PlainAuth(
-		env.SmtpIdentity,
-		env.SmtpUsername,
-		env.SmtpPassword,
-		env.SmtpServer,
-	)
-
-	return &SmtpMailProvider{
-		Environment: env,
-		Auth:        auth,
-	}
-}
-
-func (s SmtpMailProvider) Send(to []string, subject string, message string) error {
-	payload := fmt.Sprintf(
-		"To: %s\r\n"+
-			"Subject: %s\r\n"+
-			"\r\n%s\r\n",
-		to, subject, message,
-	)
-
-	return smtp.SendMail(
-		fmt.Sprintf("%s:%d", s.SmtpServer, s.SmtpPort),
-		s.Auth,
-		s.SmtpUsername,
-		to,
-		[]byte(payload),
-	)
-}
diff --git a/provider/mail/type.go b/provider/mail/type.go
deleted file mode 100644
index dbd185e..0000000
--- a/provider/mail/type.go
+++ /dev/null
@@ -1,19 +0,0 @@
-package mail
-
-import "context"
-
-type Mail struct {
-	To      []string
-	Subject string
-	Message string
-}
-
-type MailProvider interface {
-	Send(to []string, subject string, message string) error
-}
-
-type MailQueue interface {
-	Send(mail Mail)
-	Flush()
-	Start(ctx context.Context)
-}
diff --git a/repository/user/type.go b/repository/user/type.go
index 43ba1ea..047ee69 100644
--- a/repository/user/type.go
+++ b/repository/user/type.go
@@ -9,5 +9,4 @@ type UserRepository interface {
 	Get(username string) (*user.User, error)
 	Update(user user.User) error
 	Delete(username string) error
-	IsExist(user string) (bool, error)
 }
diff --git a/repository/user/user.go b/repository/user/user.go
index 9085874..881a4c6 100644
--- a/repository/user/user.go
+++ b/repository/user/user.go
@@ -1,8 +1,6 @@
 package user
 
 import (
-	"errors"
-
 	"gitlab.informatika.org/ocw/ocw-backend/model/domain/user"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/db"
 	"gorm.io/gorm"
@@ -18,27 +16,13 @@ func New(
 	return &UserRepositoryImpl{db.Connect()}
 }
 
-func (repo UserRepositoryImpl) IsExist(email string) (bool, error) {
-	_, err := repo.Get(email)
-
-	if err != nil {
-		if errors.Is(err, gorm.ErrRecordNotFound) {
-			return true, nil
-		}
-
-		return true, err
-	}
-
-	return false, nil
-}
-
 func (repo UserRepositoryImpl) Add(user user.User) error {
-	return repo.db.Create(&user).Error
+	return repo.db.Create(user).Error
 }
 
-func (repo UserRepositoryImpl) Get(email string) (*user.User, error) {
+func (repo UserRepositoryImpl) Get(username string) (*user.User, error) {
 	result := &user.User{}
-	err := repo.db.Where("email = ?", email).First(result).Error
+	err := repo.db.Where("username = ?", username).First(result).Error
 
 	if err != nil {
 		return nil, err
@@ -51,6 +35,6 @@ func (repo UserRepositoryImpl) Update(user user.User) error {
 	return repo.db.Save(user).Error
 }
 
-func (repo UserRepositoryImpl) Delete(email string) error {
-	return repo.db.Where("email = ?", email).Delete(&user.User{}).Error
+func (repo UserRepositoryImpl) Delete(username string) error {
+	return repo.db.Where("username = ?", username).Delete(&user.User{}).Error
 }
diff --git a/routes/auth/route.go b/routes/auth/route.go
index d7ea811..55377de 100644
--- a/routes/auth/route.go
+++ b/routes/auth/route.go
@@ -13,6 +13,5 @@ func (ar AuthRoutes) Register(r chi.Router) {
 	r.Route("/auth", func(r chi.Router) {
 		r.Post("/login", ar.AuthHandler.Login)
 		r.Post("/refresh", ar.AuthHandler.Refresh)
-		r.Post("/register", ar.AuthHandler.Register)
 	})
 }
diff --git a/service/auth/impl.go b/service/auth/impl.go
index 9ac5f34..d8ddef7 100644
--- a/service/auth/impl.go
+++ b/service/auth/impl.go
@@ -2,7 +2,6 @@ package auth
 
 import (
 	"gitlab.informatika.org/ocw/ocw-backend/repository/user"
-	"gitlab.informatika.org/ocw/ocw-backend/service/verification"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/password"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/token"
@@ -11,7 +10,6 @@ import (
 type AuthServiceImpl struct {
 	user.UserRepository
 	password.PasswordUtil
-	*env.Environment
+	env.Environment
 	token.TokenUtil
-	verification.VerificationService
 }
diff --git a/service/auth/login.go b/service/auth/login.go
index 33d5223..0ed6024 100644
--- a/service/auth/login.go
+++ b/service/auth/login.go
@@ -2,24 +2,24 @@ package auth
 
 import (
 	"errors"
+	"fmt"
 	"time"
 
 	"github.com/golang-jwt/jwt/v4"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/login"
 	tokenModel "gitlab.informatika.org/ocw/ocw-backend/model/web/auth/token"
 	"gorm.io/gorm"
 )
 
 func (auth AuthServiceImpl) Login(payload login.LoginRequestPayload) (*login.LoginResponsePayload, error) {
-	user, err := auth.UserRepository.Get(payload.Email)
+	user, err := auth.Get(payload.Email)
 
 	if err != nil {
 		var errorObj error
 
 		switch {
 		case errors.Is(err, gorm.ErrRecordNotFound):
-			errorObj = web.NewResponseError("username and password combination not found", web.InvalidLogin)
+			errorObj = fmt.Errorf("username and password combination not found")
 		default:
 			errorObj = err
 		}
@@ -28,11 +28,11 @@ func (auth AuthServiceImpl) Login(payload login.LoginRequestPayload) (*login.Log
 	}
 
 	if err := auth.Check(payload.Password, user.Password); err != nil {
-		return nil, web.NewResponseError("username and password combination not found", web.InvalidLogin)
+		return nil, fmt.Errorf("username and password combination not found")
 	}
 
 	if !user.IsActivated {
-		return nil, web.NewResponseError("user is not activated yet", web.InactiveUser)
+		return nil, fmt.Errorf("user is not activated yet")
 	}
 
 	refreshClaim := tokenModel.UserClaim{
@@ -59,12 +59,14 @@ func (auth AuthServiceImpl) Login(payload login.LoginRequestPayload) (*login.Log
 		},
 	}
 
-	refreshToken, err := auth.TokenUtil.Generate(refreshClaim, auth.TokenUtil.DefaultMethod())
+	refreshToken, err := auth.TokenUtil.Generate(refreshClaim)
+
 	if err != nil {
 		return nil, err
 	}
 
-	accessToken, err := auth.TokenUtil.Generate(accessClaim, auth.TokenUtil.DefaultMethod())
+	accessToken, err := auth.TokenUtil.Generate(accessClaim)
+
 	if err != nil {
 		return nil, err
 	}
diff --git a/service/auth/refresh.go b/service/auth/refresh.go
index 0230677..70aecd6 100644
--- a/service/auth/refresh.go
+++ b/service/auth/refresh.go
@@ -4,7 +4,6 @@ import (
 	"time"
 
 	"github.com/golang-jwt/jwt/v4"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/refresh"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/token"
 )
@@ -13,13 +12,13 @@ func (auth AuthServiceImpl) Refresh(payload refresh.RefreshRequestPayload) (*ref
 	claim, err := auth.TokenUtil.Validate(payload.RefreshToken, token.Refresh)
 
 	if err != nil {
-		return nil, web.NewResponseErrorFromError(err, web.TokenError)
+		return nil, err
 	}
 
 	claim.ExpiresAt = jwt.NewNumericDate(time.Now().Add(time.Duration(auth.TokenAccessExpired) * time.Millisecond))
 	claim.Type = token.Access
 
-	newToken, err := auth.TokenUtil.Generate(*claim, auth.TokenUtil.DefaultMethod())
+	newToken, err := auth.TokenUtil.Generate(*claim)
 
 	if err != nil {
 		return nil, err
diff --git a/service/auth/register.go b/service/auth/register.go
deleted file mode 100644
index 6eb423b..0000000
--- a/service/auth/register.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package auth
-
-import (
-	"gitlab.informatika.org/ocw/ocw-backend/model/domain/user"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/register"
-)
-
-func (auth AuthServiceImpl) Register(payload register.RegisterRequestPayload) error {
-	err := auth.UserRepository.Add(user.User{
-		Email:       payload.Email,
-		Password:    payload.Password,
-		Name:        payload.Name,
-		Role:        user.Student,
-		IsActivated: false,
-	})
-
-	if err == nil {
-		auth.SendVerifyMail(payload.Email)
-	}
-
-	return err
-}
diff --git a/service/auth/type.go b/service/auth/type.go
index 2503726..87a4615 100644
--- a/service/auth/type.go
+++ b/service/auth/type.go
@@ -3,11 +3,9 @@ package auth
 import (
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/login"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/refresh"
-	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/register"
 )
 
 type AuthService interface {
 	Login(payload login.LoginRequestPayload) (*login.LoginResponsePayload, error)
 	Refresh(payload refresh.RefreshRequestPayload) (*refresh.RefreshResponsePayload, error)
-	Register(payload register.RegisterRequestPayload) error
 }
diff --git a/service/di.go b/service/di.go
index ee7d5e8..b2eb205 100644
--- a/service/di.go
+++ b/service/di.go
@@ -7,7 +7,6 @@ import (
 	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
 	"gitlab.informatika.org/ocw/ocw-backend/service/logger/hooks"
 	"gitlab.informatika.org/ocw/ocw-backend/service/reporter"
-	"gitlab.informatika.org/ocw/ocw-backend/service/verification"
 )
 
 var ServiceTestSet = wire.NewSet(
@@ -25,15 +24,9 @@ var ServiceTestSet = wire.NewSet(
 
 	// auth service
 	wire.NewSet(
-		wire.Struct(new(auth.AuthServiceImpl), "*"),
+		wire.Struct(new(auth.AuthServiceImpl)),
 		wire.Bind(new(auth.AuthService), new(*auth.AuthServiceImpl)),
 	),
-
-	// verification service
-	wire.NewSet(
-		wire.Struct(new(verification.VerificationServiceImpl), "*"),
-		wire.Bind(new(verification.VerificationService), new(*verification.VerificationServiceImpl)),
-	),
 )
 
 var ServiceSet = wire.NewSet(
diff --git a/service/reporter/logtail.go b/service/reporter/logtail.go
index 50d58d9..db034e1 100644
--- a/service/reporter/logtail.go
+++ b/service/reporter/logtail.go
@@ -134,16 +134,7 @@ func (l *LogtailReporter) Start(ctx context.Context) {
 
 	go func() {
 		l.isStarted = true
-		defer func() {
-			l.isStarted = false
-
-			l.logUtil.PrintFormattedOutput(
-				"Reporter has been stopped.",
-				"Report",
-				"info",
-				log.ForeGreen,
-			)
-		}()
+		defer func() { l.isStarted = false }()
 		defer l.Flush()
 
 		interval := time.Duration(l.env.LogFlushInterval)
@@ -157,12 +148,10 @@ func (l *LogtailReporter) Start(ctx context.Context) {
 			log.ForeGreen,
 		)
 
-		isLoop := true
-
-		for isLoop {
+		for {
 			select {
 			case <-ctx.Done():
-				isLoop = false
+				break
 			case <-timer.C:
 				l.Flush()
 			}
diff --git a/service/verification/impl.go b/service/verification/impl.go
deleted file mode 100644
index 94db174..0000000
--- a/service/verification/impl.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package verification
-
-import (
-	"gitlab.informatika.org/ocw/ocw-backend/provider/mail"
-	"gitlab.informatika.org/ocw/ocw-backend/repository/user"
-)
-
-type VerificationServiceImpl struct {
-	mail.MailQueue
-	user.UserRepository
-}
diff --git a/service/verification/send.go b/service/verification/send.go
deleted file mode 100644
index 9f404a8..0000000
--- a/service/verification/send.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package verification
-
-func (v VerificationServiceImpl) SendVerifyMail(email string) error {
-	// TODO
-	return nil
-}
diff --git a/service/verification/type.go b/service/verification/type.go
deleted file mode 100644
index e6df1d1..0000000
--- a/service/verification/type.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package verification
-
-type VerificationService interface {
-	SendVerifyMail(email string) error
-	SetVerification(email string, isVerified bool) error
-}
diff --git a/service/verification/verify.go b/service/verification/verify.go
deleted file mode 100644
index b18ce1e..0000000
--- a/service/verification/verify.go
+++ /dev/null
@@ -1,6 +0,0 @@
-package verification
-
-func (v VerificationServiceImpl) SetVerification(email string, isVerified bool) error {
-	// TODO
-	return nil
-}
diff --git a/test/api.go b/test/api.go
deleted file mode 100644
index b67503d..0000000
--- a/test/api.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package test
-
-import (
-	"gitlab.informatika.org/ocw/ocw-backend/test/db"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/app"
-)
-
-type ApiTestPack struct {
-	*db.MockDatabase
-	app.Server
-}
diff --git a/test/db/di.go b/test/db/di.go
deleted file mode 100644
index e1a84e9..0000000
--- a/test/db/di.go
+++ /dev/null
@@ -1,11 +0,0 @@
-package db
-
-import (
-	"github.com/google/wire"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/db"
-)
-
-var DbTestSet = wire.NewSet(
-	New,
-	wire.Bind(new(db.Database), new(*MockDatabase)),
-)
diff --git a/test/db/mock.go b/test/db/mock.go
deleted file mode 100644
index 8e86aa0..0000000
--- a/test/db/mock.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package db
-
-import (
-	"github.com/DATA-DOG/go-sqlmock"
-	"gorm.io/driver/postgres"
-	"gorm.io/gorm"
-)
-
-type MockDatabase struct {
-	db   *gorm.DB
-	Mock sqlmock.Sqlmock
-}
-
-func New() (*MockDatabase, error) {
-	db, mock, err := sqlmock.New()
-
-	if err != nil {
-		return nil, err
-	}
-
-	g, err := gorm.Open(postgres.New(
-		postgres.Config{
-			Conn: db,
-		},
-	), &gorm.Config{})
-
-	return &MockDatabase{g, mock}, err
-}
-
-func (m MockDatabase) Connect() *gorm.DB {
-	return m.db
-}
diff --git a/test/di.go b/test/di.go
index 46c1653..9030d58 100644
--- a/test/di.go
+++ b/test/di.go
@@ -8,29 +8,22 @@ import (
 
 	"gitlab.informatika.org/ocw/ocw-backend/handler"
 	"gitlab.informatika.org/ocw/ocw-backend/middleware"
-	"gitlab.informatika.org/ocw/ocw-backend/provider"
-	"gitlab.informatika.org/ocw/ocw-backend/repository"
 	"gitlab.informatika.org/ocw/ocw-backend/routes"
 	"gitlab.informatika.org/ocw/ocw-backend/service"
 	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
-	"gitlab.informatika.org/ocw/ocw-backend/test/db"
 	"gitlab.informatika.org/ocw/ocw-backend/utils"
 
+	"gitlab.informatika.org/ocw/ocw-backend/utils/app"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 )
 
-func CreateServer(logger logger.Logger, envTest *env.Environment) (*ApiTestPack, error) {
+func CreateServer(logger logger.Logger, envTest *env.Environment) (app.Server, error) {
 	wire.Build(
-		wire.Struct(new(ApiTestPack), "*"),
-
 		utils.UtilSetTest,
-		repository.RepositoryBasicSet,
 		handler.HandlerSet,
 		middleware.MiddlewareSet,
 		routes.RoutesSet,
 		service.ServiceTestSet,
-		db.DbTestSet,
-		provider.ProviderSet,
 	)
 
 	return nil, nil
diff --git a/test/utils/base.go b/test/utils/base.go
index e744a1f..4a75e77 100644
--- a/test/utils/base.go
+++ b/test/utils/base.go
@@ -4,20 +4,19 @@ import (
 	"net/http"
 
 	"gitlab.informatika.org/ocw/ocw-backend/test"
-	"gitlab.informatika.org/ocw/ocw-backend/test/db"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 )
 
-func NewTestHandler() (http.Handler, *MockLogger, *db.MockDatabase, error) {
+func NewTestHandler() (http.Handler, *MockLogger, error) {
 	logger := NewMockLogger()
 	handler, err := test.CreateServer(logger, &env.Environment{
 		AppEnvironment: "DEVELOPMENT",
 	})
 
 	if err != nil {
-		return nil, nil, nil, err
+		return nil, nil, err
 	}
 
 	logger.CleanLog()
-	return handler.GetServer(), logger, handler.MockDatabase, nil
+	return handler.GetServer(), logger, nil
 }
diff --git a/test/utils/executor.go b/test/utils/executor.go
index ced02a1..1b4fda6 100644
--- a/test/utils/executor.go
+++ b/test/utils/executor.go
@@ -15,7 +15,7 @@ type RequestData struct {
 }
 
 func ExecuteJSON(reqData RequestData) (*http.Response, *MockLogger, error) {
-	r, log, _, err := NewTestHandler()
+	r, log, err := NewTestHandler()
 
 	if err != nil {
 		return nil, nil, err
@@ -50,32 +50,3 @@ func ExecuteJSON(reqData RequestData) (*http.Response, *MockLogger, error) {
 
 	return res, log, nil
 }
-
-func ExecuteJSONWithHandler(r http.Handler, reqData RequestData) (*http.Response, error) {
-	var req *http.Request
-
-	if reqData.Data == nil {
-		req = httptest.NewRequest(reqData.Method, reqData.Endpoint, nil)
-	} else {
-		byteData, err := json.Marshal(reqData.Data)
-
-		if err != nil {
-			return nil, err
-		}
-
-		reader := bytes.NewReader(byteData)
-		req = httptest.NewRequest(reqData.Method, reqData.Endpoint, reader)
-	}
-
-	if reqData.Headers != nil {
-		for key, value := range reqData.Headers {
-			req.Header.Add(key, value)
-		}
-	}
-
-	rec := httptest.NewRecorder()
-
-	r.ServeHTTP(rec, req)
-
-	return rec.Result(), nil
-}
diff --git a/test/utils/password/password_test.go b/test/utils/password/password_test.go
index 3ffa6e8..e7205b8 100644
--- a/test/utils/password/password_test.go
+++ b/test/utils/password/password_test.go
@@ -4,16 +4,11 @@ import (
 	"testing"
 
 	"github.com/stretchr/testify/assert"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/password"
 )
 
 func TestPasswordHash(t *testing.T) {
-	obj := password.PasswordUtilImpl{
-		Environment: &env.Environment{
-			PasswordCost: 10,
-		},
-	}
+	obj := password.PasswordUtilImpl{}
 
 	t.Run("PasswordCanBeHashed", func(t *testing.T) {
 		_, err := obj.Hash("admin")
@@ -21,18 +16,9 @@ func TestPasswordHash(t *testing.T) {
 		assert.Nil(t, err)
 	})
 
-	t.Run("PasswordHashMustBeDifferOnSamePass", func(t *testing.T) {
-		hash1, err := obj.Hash("admin")
-		assert.Nil(t, err)
-
-		hash2, err := obj.Hash("admin")
-		assert.Nil(t, err)
-
-		assert.NotEqual(t, hash1, hash2)
-	})
-
 	t.Run("PasswordCanBeHashAndValidateCorrectly", func(t *testing.T) {
 		hash, err := obj.Hash("admin")
+
 		assert.Nil(t, err)
 
 		err = obj.Check("admin", hash)
diff --git a/test/utils/token/token_test.go b/test/utils/token/token_test.go
deleted file mode 100644
index 5f950ba..0000000
--- a/test/utils/token/token_test.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package token_test
-
-import (
-	"testing"
-	"time"
-
-	"github.com/golang-jwt/jwt/v4"
-	"github.com/stretchr/testify/assert"
-	"gitlab.informatika.org/ocw/ocw-backend/model/domain/user"
-	tokenData "gitlab.informatika.org/ocw/ocw-backend/model/web/auth/token"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
-	"gitlab.informatika.org/ocw/ocw-backend/utils/token"
-)
-
-func TestToken(t *testing.T) {
-	tokenObj := token.TokenUtilImpl{
-		Environment: &env.Environment{
-			TokenSecret: "secret",
-			TokenMethod: "hs512",
-		},
-	}
-
-	t.Run("UserTokenTest", func(t *testing.T) {
-		claim := tokenData.UserClaim{
-			Name:  "Someone",
-			Email: "someone@example.com",
-			Role:  user.Student,
-			Type:  tokenData.Refresh,
-		}
-
-		token, err := tokenObj.Generate(claim, tokenObj.DefaultMethod())
-		assert.Nil(t, err)
-
-		extractedToken, err := tokenObj.Validate(token, tokenData.Refresh)
-		assert.Nil(t, err)
-		assert.NotNil(t, extractedToken)
-
-		assert.Equal(t, claim, *extractedToken)
-	})
-
-	t.Run("UserTokenInvalidType", func(t *testing.T) {
-		claim := tokenData.UserClaim{
-			Name:  "Someone",
-			Email: "someone@example.com",
-			Role:  user.Student,
-			Type:  tokenData.Refresh,
-		}
-
-		token, err := tokenObj.Generate(claim, tokenObj.DefaultMethod())
-		assert.Nil(t, err)
-
-		extractedToken, err := tokenObj.Validate(token, tokenData.Access)
-		assert.NotNil(t, err)
-		assert.Nil(t, extractedToken)
-		assert.Equal(t, err.Error(), "token type is not valid")
-	})
-
-	t.Run("UserTokenExpired", func(t *testing.T) {
-		claim := tokenData.UserClaim{
-			Name:  "Someone",
-			Email: "someone@example.com",
-			Role:  user.Student,
-			Type:  tokenData.Refresh,
-			RegisteredClaims: jwt.RegisteredClaims{
-				ExpiresAt: jwt.NewNumericDate(time.Now()),
-			},
-		}
-
-		token, err := tokenObj.Generate(claim, tokenObj.DefaultMethod())
-		assert.Nil(t, err)
-
-		extractedToken, err := tokenObj.Validate(token, tokenData.Refresh)
-		assert.NotNil(t, err)
-		assert.Nil(t, extractedToken)
-		assert.Contains(t, err.Error(), "expired")
-	})
-}
diff --git a/utils/app/app.go b/utils/app/app.go
index fe94450..03fb683 100644
--- a/utils/app/app.go
+++ b/utils/app/app.go
@@ -3,7 +3,6 @@ package app
 import (
 	"github.com/go-chi/chi/v5"
 	"gitlab.informatika.org/ocw/ocw-backend/middleware"
-	"gitlab.informatika.org/ocw/ocw-backend/provider/mail"
 	"gitlab.informatika.org/ocw/ocw-backend/routes"
 	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
 	"gitlab.informatika.org/ocw/ocw-backend/service/reporter"
@@ -19,7 +18,6 @@ type HttpServer struct {
 	res             res.Resource
 	env             *env.Environment
 	reporter        reporter.Reporter
-	mail            mail.MailQueue
 	middlewaresName []string
 }
 
@@ -31,7 +29,6 @@ func New(
 	logUtil log.LogUtils,
 	res res.Resource,
 	reporter reporter.Reporter,
-	mailqueue mail.MailQueue,
 ) *HttpServer {
 	r := chi.NewRouter()
 
@@ -52,6 +49,5 @@ func New(
 		env:             env,
 		reporter:        reporter,
 		middlewaresName: middlewareName,
-		mail:            mailqueue,
 	}
 }
diff --git a/utils/app/start.go b/utils/app/start.go
index 239f315..1ea8ecd 100644
--- a/utils/app/start.go
+++ b/utils/app/start.go
@@ -23,7 +23,6 @@ func (l *HttpServer) Start() {
 
 	serverCtx, cancelServer := context.WithCancel(context.Background())
 	l.reporter.Start(serverCtx)
-	l.mail.Start(serverCtx)
 
 	sig := make(chan os.Signal, 3)
 	signal.Notify(sig, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
diff --git a/utils/db/database.go b/utils/db/database.go
index 66f170b..cf75454 100644
--- a/utils/db/database.go
+++ b/utils/db/database.go
@@ -1,12 +1,8 @@
 package db
 
 import (
-	"fmt"
-	"os"
-	"runtime/debug"
-	"strings"
+	"database/sql"
 
-	"gitlab.informatika.org/ocw/ocw-backend/service/logger"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 	"gorm.io/driver/postgres"
 	"gorm.io/gorm"
@@ -16,29 +12,23 @@ type DatabaseImpl struct {
 	DB *gorm.DB
 }
 
-func resolver(log logger.Logger) {
-	if rec := recover(); rec != nil {
-		log.Error("Some panic occured when processing request:")
-		log.Error(fmt.Sprint(rec))
-		log.Error("")
-
-		log.Error("Stack Trace:")
-		stacks := strings.Split(string(debug.Stack()), "\n")
-
-		for _, val := range stacks {
-			log.Error(val)
-		}
+func NewPostgresConn(
+	conn *sql.Conn,
+) (*DatabaseImpl, error) {
+	res, err := gorm.Open(postgres.New(postgres.Config{
+		Conn: conn,
+	}), &gorm.Config{})
 
-		os.Exit(-1)
+	if err != nil {
+		return nil, err
 	}
+
+	return &DatabaseImpl{res}, nil
 }
 
 func NewPostgresEnv(
-	env *env.Environment,
-	log logger.Logger,
+	env env.Environment,
 ) (*DatabaseImpl, error) {
-	defer resolver(log)
-
 	res, err := gorm.Open(postgres.Open(env.DatabaseConnection), &gorm.Config{})
 
 	if err != nil {
diff --git a/utils/di.go b/utils/di.go
index 83aae42..5b8ac4d 100644
--- a/utils/di.go
+++ b/utils/di.go
@@ -14,6 +14,10 @@ import (
 	"gitlab.informatika.org/ocw/ocw-backend/utils/wrapper"
 )
 
+var DatabaseTestingSet = wire.NewSet(
+	db.NewPostgresConn,
+)
+
 var UtilSetTest = wire.NewSet(
 	// httputil utility
 	wire.Struct(new(httputil.HttpUtilImpl), "*"),
@@ -49,12 +53,12 @@ var UtilSetTest = wire.NewSet(
 )
 
 var UtilSet = wire.NewSet(
-	// env
-	env.New,
-
 	UtilSetTest,
 
 	// Database utility
 	wire.Bind(new(db.Database), new(*db.DatabaseImpl)),
 	db.NewPostgresEnv,
+
+	// env
+	env.New,
 )
diff --git a/utils/env/env.go b/utils/env/env.go
index a55416e..1112fb6 100644
--- a/utils/env/env.go
+++ b/utils/env/env.go
@@ -27,15 +27,6 @@ type Environment struct {
 	TokenRefreshExpired int64  `env:"TOKEN_REFRESH_EXPIRED_MS" envDefault:"86400000"`
 	TokenAccessExpired  int64  `env:"TOKEN_ACCESS_EXPIRED_MS" envDefault:"300000"`
 	TokenIssuer         string `env:"TOKEN_ISSUER" envDefault:"ocw"`
-
-	MailingProvider string `env:"MAIL_PROVIDER" envDefault:"smtp"`
-	MailingInterval int64  `env:"MAIL_INTERVAL_MS" envDefault:"1000"`
-
-	SmtpIdentity string `env:"SMTP_IDENTITY"`
-	SmtpUsername string `env:"SMTP_USERNAME"`
-	SmtpPassword string `env:"SMTP_PASSWORD"`
-	SmtpServer   string `env:"SMTP_SERVER"`
-	SmtpPort     int    `env:"SMTP_PORT" envDefault:"25"`
 }
 
 func New() (*Environment, error) {
diff --git a/utils/password/impl.go b/utils/password/impl.go
index 63a6ed2..9a660b4 100644
--- a/utils/password/impl.go
+++ b/utils/password/impl.go
@@ -3,12 +3,14 @@ package password
 import (
 	"fmt"
 
+	"gitlab.informatika.org/ocw/ocw-backend/utils/base64"
 	"gitlab.informatika.org/ocw/ocw-backend/utils/env"
 	"golang.org/x/crypto/bcrypt"
 )
 
 type PasswordUtilImpl struct {
-	*env.Environment
+	env.Environment
+	base64.Base64Util
 }
 
 func (e PasswordUtilImpl) Hash(password string) (string, error) {
diff --git a/utils/token/impl.go b/utils/token/impl.go
index 3f026c5..9dde3aa 100644
--- a/utils/token/impl.go
+++ b/utils/token/impl.go
@@ -9,10 +9,10 @@ import (
 )
 
 type TokenUtilImpl struct {
-	*env.Environment
+	env.Environment
 }
 
-func (t TokenUtilImpl) DefaultMethod() jwt.SigningMethod {
+func (t TokenUtilImpl) Method() jwt.SigningMethod {
 	switch t.TokenMethod {
 	case "hs256":
 		return jwt.SigningMethodHS256
@@ -22,36 +22,32 @@ func (t TokenUtilImpl) DefaultMethod() jwt.SigningMethod {
 }
 
 func (tu TokenUtilImpl) Validate(tokenString string, tokenType token.TokenType) (*token.UserClaim, error) {
-	jwtData, err := jwt.ParseWithClaims(tokenString, &token.UserClaim{}, func(t *jwt.Token) (interface{}, error) {
+	jwtData, err := jwt.Parse(tokenString, func(t *jwt.Token) (interface{}, error) {
 		if method, ok := t.Method.(*jwt.SigningMethodHMAC); !ok {
 			return nil, fmt.Errorf("invalid signing method")
-		} else if method != tu.DefaultMethod() {
+		} else if method != tu.Method() {
 			return nil, fmt.Errorf("invalid signing method")
 		}
 
-		return []byte(tu.Environment.TokenSecret), nil
+		return tu.Method(), nil
 	})
 
 	if err != nil {
 		return nil, err
 	}
 
-	claims, ok := jwtData.Claims.(*token.UserClaim)
-
-	if !ok {
-		return nil, fmt.Errorf("invalid claim")
-	}
+	claims := jwtData.Claims.(*token.UserClaim)
 
 	if claims.Type != tokenType {
-		return nil, fmt.Errorf("token type is not valid")
+		return claims, fmt.Errorf("token type is not valid")
 	}
 
 	return claims, nil
 }
 
-func (t TokenUtilImpl) Generate(claim token.UserClaim, method jwt.SigningMethod) (string, error) {
+func (t TokenUtilImpl) Generate(claim token.UserClaim) (string, error) {
 	token := jwt.NewWithClaims(
-		method,
+		jwt.SigningMethodHS512,
 		claim,
 	)
 
diff --git a/utils/token/type.go b/utils/token/type.go
index d338aad..cd6c27a 100644
--- a/utils/token/type.go
+++ b/utils/token/type.go
@@ -1,12 +1,10 @@
 package token
 
 import (
-	"github.com/golang-jwt/jwt/v4"
 	"gitlab.informatika.org/ocw/ocw-backend/model/web/auth/token"
 )
 
 type TokenUtil interface {
 	Validate(jwt string, tokenType token.TokenType) (*token.UserClaim, error)
-	Generate(claim token.UserClaim, method jwt.SigningMethod) (string, error)
-	DefaultMethod() jwt.SigningMethod
+	Generate(claim token.UserClaim) (string, error)
 }
-- 
GitLab