feat: add http handlers, docs
This commit is contained in:
parent
5829b471d5
commit
b2d5659aec
164
docs/docs.go
164
docs/docs.go
@ -9,16 +9,7 @@ const docTemplate = `{
|
|||||||
"info": {
|
"info": {
|
||||||
"description": "{{escape .Description}}",
|
"description": "{{escape .Description}}",
|
||||||
"title": "{{.Title}}",
|
"title": "{{.Title}}",
|
||||||
"termsOfService": "http://swagger.io/terms/",
|
"contact": {},
|
||||||
"contact": {
|
|
||||||
"name": "API Support",
|
|
||||||
"url": "http://www.swagger.io/support",
|
|
||||||
"email": "support@swagger.io"
|
|
||||||
},
|
|
||||||
"license": {
|
|
||||||
"name": "Apache 2.0",
|
|
||||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
||||||
},
|
|
||||||
"version": "{{.Version}}"
|
"version": "{{.Version}}"
|
||||||
},
|
},
|
||||||
"host": "{{.Host}}",
|
"host": "{{.Host}}",
|
||||||
@ -127,6 +118,110 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/auth/send-otp": {
|
||||||
|
"post": {
|
||||||
|
"description": "Send OTP code to the provided phone number",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"auth"
|
||||||
|
],
|
||||||
|
"summary": "Send OTP code",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "OTP Request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPProviderReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPProviderResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/auth/verify-otp": {
|
||||||
|
"post": {
|
||||||
|
"description": "Verify the provided OTP code for the phone number",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"auth"
|
||||||
|
],
|
||||||
|
"summary": "Verify OTP code",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "OTP Verify Request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPVerifyRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPVerifyResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
@ -183,18 +278,57 @@ const docTemplate = `{
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPProviderReq": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"receptor": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPProviderResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPVerifyRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"code",
|
||||||
|
"phone"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"code": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"phone": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPVerifyResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`
|
}`
|
||||||
|
|
||||||
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
||||||
var SwaggerInfo = &swag.Spec{
|
var SwaggerInfo = &swag.Spec{
|
||||||
Version: "1.0",
|
Version: "",
|
||||||
Host: "localhost:8080",
|
Host: "",
|
||||||
BasePath: "/api",
|
BasePath: "",
|
||||||
Schemes: []string{},
|
Schemes: []string{},
|
||||||
Title: "DeZone API",
|
Title: "",
|
||||||
Description: "This is the DeZone backend API server.",
|
Description: "",
|
||||||
InfoInstanceName: "swagger",
|
InfoInstanceName: "swagger",
|
||||||
SwaggerTemplate: docTemplate,
|
SwaggerTemplate: docTemplate,
|
||||||
LeftDelim: "{{",
|
LeftDelim: "{{",
|
||||||
|
|||||||
@ -1,22 +1,8 @@
|
|||||||
{
|
{
|
||||||
"swagger": "2.0",
|
"swagger": "2.0",
|
||||||
"info": {
|
"info": {
|
||||||
"description": "This is the DeZone backend API server.",
|
"contact": {}
|
||||||
"title": "DeZone API",
|
|
||||||
"termsOfService": "http://swagger.io/terms/",
|
|
||||||
"contact": {
|
|
||||||
"name": "API Support",
|
|
||||||
"url": "http://www.swagger.io/support",
|
|
||||||
"email": "support@swagger.io"
|
|
||||||
},
|
},
|
||||||
"license": {
|
|
||||||
"name": "Apache 2.0",
|
|
||||||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
||||||
},
|
|
||||||
"version": "1.0"
|
|
||||||
},
|
|
||||||
"host": "localhost:8080",
|
|
||||||
"basePath": "/api",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"/auth/authenticate": {
|
"/auth/authenticate": {
|
||||||
"post": {
|
"post": {
|
||||||
@ -121,6 +107,110 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"/auth/send-otp": {
|
||||||
|
"post": {
|
||||||
|
"description": "Send OTP code to the provided phone number",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"auth"
|
||||||
|
],
|
||||||
|
"summary": "Send OTP code",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "OTP Request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPProviderReq"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPProviderResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"description": "Internal Server Error",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"/auth/verify-otp": {
|
||||||
|
"post": {
|
||||||
|
"description": "Verify the provided OTP code for the phone number",
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"produces": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"auth"
|
||||||
|
],
|
||||||
|
"summary": "Verify OTP code",
|
||||||
|
"parameters": [
|
||||||
|
{
|
||||||
|
"description": "OTP Verify Request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPVerifyRequest"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"description": "OK",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/dto.OTPVerifyResponse"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"description": "Bad Request",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"401": {
|
||||||
|
"description": "Unauthorized",
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"definitions": {
|
"definitions": {
|
||||||
@ -177,6 +267,45 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPProviderReq": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"receptor": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPProviderResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPVerifyRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"code",
|
||||||
|
"phone"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"code": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"phone": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dto.OTPVerifyResponse": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"message": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,3 @@
|
|||||||
basePath: /api
|
|
||||||
definitions:
|
definitions:
|
||||||
dto.AuthenticateRequest:
|
dto.AuthenticateRequest:
|
||||||
properties:
|
properties:
|
||||||
@ -35,19 +34,33 @@ definitions:
|
|||||||
timeStamp:
|
timeStamp:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
host: localhost:8080
|
dto.OTPProviderReq:
|
||||||
|
properties:
|
||||||
|
receptor:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
dto.OTPProviderResponse:
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
dto.OTPVerifyRequest:
|
||||||
|
properties:
|
||||||
|
code:
|
||||||
|
type: string
|
||||||
|
phone:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- code
|
||||||
|
- phone
|
||||||
|
type: object
|
||||||
|
dto.OTPVerifyResponse:
|
||||||
|
properties:
|
||||||
|
message:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
info:
|
info:
|
||||||
contact:
|
contact: {}
|
||||||
email: support@swagger.io
|
|
||||||
name: API Support
|
|
||||||
url: http://www.swagger.io/support
|
|
||||||
description: This is the DeZone backend API server.
|
|
||||||
license:
|
|
||||||
name: Apache 2.0
|
|
||||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
termsOfService: http://swagger.io/terms/
|
|
||||||
title: DeZone API
|
|
||||||
version: "1.0"
|
|
||||||
paths:
|
paths:
|
||||||
/auth/authenticate:
|
/auth/authenticate:
|
||||||
post:
|
post:
|
||||||
@ -117,4 +130,72 @@ paths:
|
|||||||
summary: Generate authentication challenge
|
summary: Generate authentication challenge
|
||||||
tags:
|
tags:
|
||||||
- auth
|
- auth
|
||||||
|
/auth/send-otp:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Send OTP code to the provided phone number
|
||||||
|
parameters:
|
||||||
|
- description: OTP Request
|
||||||
|
in: body
|
||||||
|
name: request
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/dto.OTPProviderReq'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/dto.OTPProviderResponse'
|
||||||
|
"400":
|
||||||
|
description: Bad Request
|
||||||
|
schema:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
"500":
|
||||||
|
description: Internal Server Error
|
||||||
|
schema:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
summary: Send OTP code
|
||||||
|
tags:
|
||||||
|
- auth
|
||||||
|
/auth/verify-otp:
|
||||||
|
post:
|
||||||
|
consumes:
|
||||||
|
- application/json
|
||||||
|
description: Verify the provided OTP code for the phone number
|
||||||
|
parameters:
|
||||||
|
- description: OTP Verify Request
|
||||||
|
in: body
|
||||||
|
name: request
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/dto.OTPVerifyRequest'
|
||||||
|
produces:
|
||||||
|
- application/json
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
schema:
|
||||||
|
$ref: '#/definitions/dto.OTPVerifyResponse'
|
||||||
|
"400":
|
||||||
|
description: Bad Request
|
||||||
|
schema:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
"401":
|
||||||
|
description: Unauthorized
|
||||||
|
schema:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
summary: Verify OTP code
|
||||||
|
tags:
|
||||||
|
- auth
|
||||||
swagger: "2.0"
|
swagger: "2.0"
|
||||||
|
|||||||
@ -28,3 +28,16 @@ type RefreshTokenRequest struct {
|
|||||||
type OTPProviderReq struct {
|
type OTPProviderReq struct {
|
||||||
Receptor string `json:"receptor"`
|
Receptor string `json:"receptor"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type OTPProviderResponse struct {
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OTPVerifyRequest struct {
|
||||||
|
Phone string `json:"phone" validate:"required"`
|
||||||
|
Code string `json:"code" validate:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OTPVerifyResponse struct {
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|||||||
@ -91,6 +91,68 @@ func (h *AuthHandler) Authenticate(c *fiber.Ctx) error {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SendOTP sends OTP code to the provided phone number
|
||||||
|
// @Summary Send OTP code
|
||||||
|
// @Description Send OTP code to the provided phone number
|
||||||
|
// @Tags auth
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param request body dto.OTPProviderReq true "OTP Request"
|
||||||
|
// @Success 200 {object} dto.OTPProviderResponse
|
||||||
|
// @Failure 400 {object} map[string]string
|
||||||
|
// @Failure 500 {object} map[string]string
|
||||||
|
// @Router /auth/send-otp [post]
|
||||||
|
func (h *AuthHandler) SendOTP(c *fiber.Ctx) error {
|
||||||
|
var req dto.OTPProviderReq
|
||||||
|
if err := c.BodyParser(&req); err != nil {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "invalid request body",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err := h.authService.SendOTPCode(c.Context(), req.Receptor)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Status(fiber.StatusOK).JSON(dto.OTPProviderResponse{
|
||||||
|
Message: "OTP code sent successfully",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// VerifyOTP verifies the OTP code
|
||||||
|
// @Summary Verify OTP code
|
||||||
|
// @Description Verify the provided OTP code for the phone number
|
||||||
|
// @Tags auth
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Param request body dto.OTPVerifyRequest true "OTP Verify Request"
|
||||||
|
// @Success 200 {object} dto.OTPVerifyResponse
|
||||||
|
// @Failure 400 {object} map[string]string
|
||||||
|
// @Failure 401 {object} map[string]string
|
||||||
|
// @Router /auth/verify-otp [post]
|
||||||
|
func (h *AuthHandler) VerifyOTP(c *fiber.Ctx) error {
|
||||||
|
var req dto.OTPVerifyRequest
|
||||||
|
if err := c.BodyParser(&req); err != nil {
|
||||||
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{
|
||||||
|
"error": "invalid request body",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
err := h.authService.VerifyOTP(c.Context(), req.Phone, req.Code)
|
||||||
|
if err != nil {
|
||||||
|
return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
|
||||||
|
"error": err.Error(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return c.Status(fiber.StatusOK).JSON(dto.OTPVerifyResponse{
|
||||||
|
Message: "OTP verified successfully",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func (h *AuthHandler) HelloWorld(c *fiber.Ctx) error {
|
func (h *AuthHandler) HelloWorld(c *fiber.Ctx) error {
|
||||||
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
return c.Status(fiber.StatusOK).JSON(fiber.Map{
|
||||||
"message": "Hello, World!",
|
"message": "Hello, World!",
|
||||||
|
|||||||
@ -47,4 +47,6 @@ func registerPublicRoutes(router fiber.Router, app *app.AppContainer) {
|
|||||||
// Register auth routes
|
// Register auth routes
|
||||||
authgroup.Post("/challenge", authHandler.GenerateChallenge)
|
authgroup.Post("/challenge", authHandler.GenerateChallenge)
|
||||||
authgroup.Post("/authenticate", authHandler.Authenticate)
|
authgroup.Post("/authenticate", authHandler.Authenticate)
|
||||||
|
authgroup.Post("/send-otp", authHandler.SendOTP)
|
||||||
|
authgroup.Post("/verify-otp", authHandler.VerifyOTP)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import (
|
|||||||
type AuthService interface {
|
type AuthService interface {
|
||||||
GenerateChallenge(ctx context.Context, pubKey string) (*domain.Challenge, error)
|
GenerateChallenge(ctx context.Context, pubKey string) (*domain.Challenge, error)
|
||||||
Authenticate(ctx context.Context, pubKey string, signature string, chainID uint, ipAddress, userAgent string) (*UserToken, error)
|
Authenticate(ctx context.Context, pubKey string, signature string, chainID uint, ipAddress, userAgent string) (*UserToken, error)
|
||||||
|
SendOTPCode(ctx context.Context, phone string) (string, error)
|
||||||
|
VerifyOTP(ctx context.Context, phone, code string) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type authService struct {
|
type authService struct {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user