aboutsummaryrefslogtreecommitdiffstats
path: root/api/dto
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.com>2025-08-15 19:20:48 +0100
committerLeonardo Bishop <me@leonardobishop.com>2025-08-15 19:20:48 +0100
commit8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (patch)
tree7b4f203d92f4b99b1e98fac314415e293984196b /api/dto
parent4697556cac819c47d068819b9fc9c3b4ea84e279 (diff)
Implement OIDC
Diffstat (limited to 'api/dto')
-rw-r--r--api/dto/auth.go30
-rw-r--r--api/dto/users.go10
2 files changed, 30 insertions, 10 deletions
diff --git a/api/dto/auth.go b/api/dto/auth.go
new file mode 100644
index 0000000..0379f21
--- /dev/null
+++ b/api/dto/auth.go
@@ -0,0 +1,30 @@
+package dto
+
+type LoginBasicRequest struct {
+ Username string `json:"username" validate:"required"`
+ Password string `json:"password" validate:"required"`
+}
+
+type LoginOAuthCallbackRequest struct {
+ Code string `json:"code" validate:"required"`
+ State string `json:"state" validate:"required"`
+}
+
+type LoginOAuthOutboundResponse struct {
+ URL string `json:"url" validate:"required"`
+}
+
+type LoginResponse struct {
+ ID int32 `json:"id"`
+ Username string `json:"username"`
+}
+
+type LoginOptionsResponse struct {
+ Options []LoginOption `json:"options"`
+}
+
+type LoginOption struct {
+ Name string `json:"name"`
+ Identifier string `json:"identifier"`
+ Type string `json:"type"`
+}
diff --git a/api/dto/users.go b/api/dto/users.go
index 685fa07..5fb269f 100644
--- a/api/dto/users.go
+++ b/api/dto/users.go
@@ -8,13 +8,3 @@ type RegisterRequest struct {
type RegisterResponse struct {
ID int32 `json:"id"`
}
-
-type LoginRequest struct {
- Username string `json:"username" validate:"required"`
- Password string `json:"password" validate:"required"`
-}
-
-type LoginResponse struct {
- ID int32 `json:"id"`
- Username string `json:"username"`
-}