diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml
index 36b95b8..9d11ba7 100644
--- a/.idea/dataSources.local.xml
+++ b/.idea/dataSources.local.xml
@@ -19,5 +19,20 @@
+
+
+ "
+
+
+ master_key
+ postgres
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml
index cf4f20f..81ec136 100644
--- a/.idea/dataSources.xml
+++ b/.idea/dataSources.xml
@@ -8,5 +8,12 @@
jdbc:postgresql://localhost:5432/hy_passport
$ProjectFileDir$
+
+ postgresql
+ true
+ org.postgresql.Driver
+ jdbc:postgresql://id.solsynth.dev:5432/passport
+ $ProjectFileDir$
+
\ No newline at end of file
diff --git a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
index d818613..c25c2ac 100644
--- a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
+++ b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25.xml
@@ -3,9 +3,17 @@
mdy
- 6267
+ 1||-9223372036854775808|c|G
+1||10|c|G
+1||10|C|G
+1||10|T|G
+4||-9223372036854775808|c|G
+4||10|c|G
+4||10|C|G
+4||10|T|G
+ 6992
16.2
- 1713083875
+ 1714636069
true ACDT
true ACSST
false ACST
@@ -46,7 +54,7 @@ false Africa/Bissau
false Africa/Blantyre
false Africa/Brazzaville
false Africa/Bujumbura
-false Africa/Cairo
+true Africa/Cairo
false Africa/Casablanca
true Africa/Ceuta
false Africa/Conakry
@@ -457,7 +465,7 @@ true EGST
false EGT
false EST
true EST5EDT
-false Egypt
+true Egypt
false Eire
false Etc/GMT
false Etc/GMT+0
@@ -800,7 +808,7 @@ false Zulu
13474||10|C|G
13474||-9223372036854775808|U|G
13474||10|U|G
- 6267
+ 6992
37312
postgres
@@ -830,50 +838,50 @@ false Zulu
1
1
-
+
+ 4544
+
+
+ 6304
+
+
6171
-
- 6181
+
+ 4571
-
- 6182
-
-
+
3373
3374
3375
3377
-
+
+ 6181
+
+
3374
-
+
3375
-
- 3377
-
-
+
4569
-
- 4570
-
-
- 4571
-
-
+
4200
-
- 4544
+
+ 3377
-
+
4550
-
- 6304
+
+ 6182
+
+
+ 4570
1
@@ -4241,8 +4249,8 @@ false Zulu
standard public schema
1
- 6267
- 2024-04-20.11:07:46
+ 6992
+ 2024-05-05.03:46:49
2200
523
pg_database_owner
@@ -4335,7 +4343,23 @@ false Zulu
6249
littlesheep
-
+
+ bigint|0s
+ 37562
+ 1
+ 1
+ 6430
+ littlesheep
+
+
+ bigint|0s
+ 37551
+ 1
+ 1
+ 6427
+ littlesheep
+
+
bigint|0s
37403
1
@@ -4343,79 +4367,91 @@ false Zulu
6238
littlesheep
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+ 37563
+ 6430
+ 2
+ littlesheep
+
+
+ 37552
+ 6430
+ 2
+ littlesheep
+
+
-
+
bigint|0s
nextval('passport_account_contacts_id_seq'::regclass)
1
@@ -4424,68 +4460,68 @@ false Zulu
37369
20
-
+
timestamp with time zone|0s
2
6233
1184
-
+
timestamp with time zone|0s
3
6233
1184
-
+
timestamp with time zone|0s
4
6233
1184
-
+
smallint|0s
5
6233
21
-
+
text|0s
6
6233
25
-
+
boolean|0s
7
6233
16
-
+
boolean|0s
8
6233
16
-
+
timestamp with time zone|0s
9
6233
1184
-
+
bigint|0s
10
6233
20
-
+
account_id
37378
6233
1
37314
-
+
id
1
37376
@@ -4494,7 +4530,7 @@ false Zulu
1
403
-
+
content
37383
6234
@@ -4504,20 +4540,20 @@ false Zulu
100
pg_catalog
-
+
deleted_at
37384
6235
403
-
+
1
37377
1
6233
37376
-
+
bigint|0s
nextval('passport_account_friendships_id_seq'::regclass)
1
@@ -4526,63 +4562,63 @@ false Zulu
37385
20
-
+
timestamp with time zone|0s
2
6236
1184
-
+
timestamp with time zone|0s
3
6236
1184
-
+
timestamp with time zone|0s
4
6236
1184
-
+
bigint|0s
5
6236
20
-
+
bigint|0s
6
6236
20
-
+
bigint|0s
7
6236
20
-
+
smallint|0s
8
6236
21
-
+
account_id
37392
6236
1
37314
-
+
related_id
37397
6236
1
37314
-
+
id
1
37390
@@ -4591,20 +4627,20 @@ false Zulu
1
403
-
+
deleted_at
37402
6237
403
-
+
1
37391
1
6236
37390
-
+
bigint|0s
nextval('passport_account_pages_id_seq'::regclass)
1
@@ -4613,62 +4649,62 @@ false Zulu
37354
20
-
+
timestamp with time zone|0s
2
6231
1184
-
+
timestamp with time zone|0s
3
6231
1184
-
+
timestamp with time zone|0s
4
6231
1184
-
+
text|0s
5
6231
25
-
+
text|0s
6
6231
25
-
+
text|0s
7
6231
25
-
+
jsonb|0s
8
6231
3802
-
+
bigint|0s
9
6231
20
-
+
account_id
37363
6231
1
37314
-
+
id
1
37361
@@ -4677,20 +4713,20 @@ false Zulu
1
403
-
+
deleted_at
37368
6232
403
-
+
1
37362
1
6231
37361
-
+
bigint|0s
nextval('passport_account_profiles_id_seq'::regclass)
1
@@ -4699,62 +4735,62 @@ false Zulu
37339
20
-
+
timestamp with time zone|0s
2
6229
1184
-
+
timestamp with time zone|0s
3
6229
1184
-
+
timestamp with time zone|0s
4
6229
1184
-
+
text|0s
5
6229
25
-
+
text|0s
6
6229
25
-
+
bigint|0s
7
6229
20
-
+
timestamp with time zone|0s
8
6229
1184
-
+
bigint|0s
9
6229
20
-
+
account_id
37348
6229
1
37314
-
+
id
1
37346
@@ -4763,20 +4799,20 @@ false Zulu
1
403
-
+
deleted_at
37353
6230
403
-
+
1
37347
1
6229
37346
-
+
bigint|0s
nextval('passport_accounts_id_seq'::regclass)
1
@@ -4785,67 +4821,67 @@ false Zulu
37313
20
-
+
timestamp with time zone|0s
2
6224
1184
-
+
timestamp with time zone|0s
3
6224
1184
-
+
timestamp with time zone|0s
4
6224
1184
-
+
text|0s
5
6224
25
-
+
text|0s
6
6224
25
-
+
text|0s
7
6224
25
-
+
text|0s
8
6224
25
-
+
text|0s
9
6224
25
-
+
timestamp with time zone|0s
10
6224
1184
-
+
bigint|0s
11
6224
20
-
+
id
1
37320
@@ -4854,7 +4890,7 @@ false Zulu
1
403
-
+
name
37322
6225
@@ -4864,20 +4900,20 @@ false Zulu
100
pg_catalog
-
+
deleted_at
37323
6226
403
-
+
1
37321
1
6224
37320
-
+
bigint|0s
nextval('passport_action_events_id_seq'::regclass)
1
@@ -4886,68 +4922,68 @@ false Zulu
37474
20
-
+
timestamp with time zone|0s
2
6247
1184
-
+
timestamp with time zone|0s
3
6247
1184
-
+
timestamp with time zone|0s
4
6247
1184
-
+
text|0s
5
6247
25
-
+
text|0s
6
6247
25
-
+
text|0s
7
6247
25
-
+
text|0s
8
6247
25
-
+
text|0s
9
6247
25
-
+
bigint|0s
10
6247
20
-
+
account_id
37483
6247
1
37314
-
+
id
1
37481
@@ -4956,20 +4992,20 @@ false Zulu
1
403
-
+
deleted_at
37488
6248
403
-
+
1
37482
1
6247
37481
-
+
bigint|0s
nextval('passport_auth_factors_id_seq'::regclass)
1
@@ -4978,56 +5014,56 @@ false Zulu
37324
20
-
+
timestamp with time zone|0s
2
6227
1184
-
+
timestamp with time zone|0s
3
6227
1184
-
+
timestamp with time zone|0s
4
6227
1184
-
+
smallint|0s
5
6227
21
-
+
text|0s
6
6227
25
-
+
jsonb|0s
7
6227
3802
-
+
bigint|0s
8
6227
20
-
+
account_id
37333
6227
1
37314
-
+
id
1
37331
@@ -5036,20 +5072,20 @@ false Zulu
1
403
-
+
deleted_at
37338
6228
403
-
+
1
37332
1
6227
37331
-
+
bigint|0s
nextval('passport_auth_tickets_id_seq'::regclass)
1
@@ -5058,129 +5094,136 @@ false Zulu
37526
20
-
+
timestamp with time zone|0s
2
6259
1184
-
+
timestamp with time zone|0s
3
6259
1184
-
+
timestamp with time zone|0s
4
6259
1184
-
+
text|0s
5
6259
25
-
+
text|0s
6
6259
25
-
+
text|0s
7
6259
25
-
+
boolean|0s
8
6259
16
-
+
boolean|0s
9
6259
16
-
+
jsonb|0s
10
6259
3802
-
+
jsonb|0s
11
6259
3802
-
+
text|0s
12
6259
25
-
+
text|0s
13
6259
25
-
+
text|0s
14
6259
25
-
+
timestamp with time zone|0s
15
6259
1184
-
+
timestamp with time zone|0s
16
6259
1184
-
+
timestamp with time zone|0s
17
6259
1184
-
+
bigint|0s
18
6259
20
-
+
bigint|0s
19
6259
20
-
+
client_id
37540
6259
1
37404
-
+
account_id
37535
6259
1
37314
-
+
+ account_id
+ 37546
+ 6301
+ 1
+ 37314
+
+
id
1
37533
@@ -5189,20 +5232,20 @@ false Zulu
1
403
-
+
deleted_at
37545
6260
403
-
+
1
37534
1
6259
37533
-
+
bigint|0s
nextval('passport_magic_tokens_id_seq'::regclass)
1
@@ -5211,56 +5254,56 @@ false Zulu
37459
20
-
+
timestamp with time zone|0s
2
6245
1184
-
+
timestamp with time zone|0s
3
6245
1184
-
+
timestamp with time zone|0s
4
6245
1184
-
+
text|0s
5
6245
25
-
+
smallint|0s
6
6245
21
-
+
bigint|0s
7
6245
20
-
+
timestamp with time zone|0s
8
6245
1184
-
+
assign_to
37468
6245
1
37314
-
+
id
1
37466
@@ -5269,20 +5312,20 @@ false Zulu
1
403
-
+
deleted_at
37473
6246
403
-
+
1
37467
1
6245
37466
-
+
bigint|0s
nextval('passport_notification_subscribers_id_seq'::regclass)
1
@@ -5291,56 +5334,56 @@ false Zulu
37509
20
-
+
timestamp with time zone|0s
2
6251
1184
-
+
timestamp with time zone|0s
3
6251
1184
-
+
timestamp with time zone|0s
4
6251
1184
-
+
text|0s
5
6251
25
-
+
text|0s
6
6251
25
-
+
text|0s
7
6251
25
-
+
bigint|0s
8
6251
20
-
+
account_id
37518
6251
1
37314
-
+
id
1
37516
@@ -5349,7 +5392,7 @@ false Zulu
1
403
-
+
device_id
37523
6252
@@ -5359,20 +5402,20 @@ false Zulu
100
pg_catalog
-
+
deleted_at
37524
6253
403
-
+
1
37517
1
6251
37516
-
+
bigint|0s
nextval('passport_notifications_id_seq'::regclass)
1
@@ -5381,81 +5424,81 @@ false Zulu
37489
20
-
+
timestamp with time zone|0s
2
6249
1184
-
+
timestamp with time zone|0s
3
6249
1184
-
+
timestamp with time zone|0s
4
6249
1184
-
+
text|0s
5
6249
25
-
+
text|0s
6
6249
25
-
+
jsonb|0s
7
6249
3802
-
+
boolean|0s
8
6249
16
-
+
timestamp with time zone|0s
9
6249
1184
-
+
bigint|0s
10
6249
20
-
+
bigint|0s
11
6249
20
-
+
sender_id
37498
6249
1
37404
-
+
recipient_id
37503
6249
1
37314
-
+
id
1
37496
@@ -5464,20 +5507,196 @@ false Zulu
1
403
-
+
deleted_at
37508
6250
403
-
+
1
37497
1
6249
37496
-
+
+ bigint|0s
+ nextval('passport_realm_members_id_seq'::regclass)
+ 1
+ 1
+ 6430
+ 37562
+ 20
+
+
+ timestamp with time zone|0s
+ 2
+ 6430
+ 1184
+
+
+ timestamp with time zone|0s
+ 3
+ 6430
+ 1184
+
+
+ timestamp with time zone|0s
+ 4
+ 6430
+ 1184
+
+
+ bigint|0s
+ 5
+ 6430
+ 20
+
+
+ bigint|0s
+ 6
+ 6430
+ 20
+
+
+ bigint|0s
+ 7
+ 6430
+ 20
+
+
+ realm_id
+ 37574
+ 6430
+ 1
+ 37552
+
+
+ account_id
+ 37569
+ 6430
+ 1
+ 37314
+
+
+ id
+ 1
+ 37567
+ 1
+ 6430
+ 1
+ 403
+
+
+ deleted_at
+ 37579
+ 6431
+ 403
+
+
+ 1
+ 37568
+ 1
+ 6430
+ 37567
+
+
+ bigint|0s
+ nextval('passport_realms_id_seq'::regclass)
+ 1
+ 1
+ 6427
+ 37551
+ 20
+
+
+ timestamp with time zone|0s
+ 2
+ 6427
+ 1184
+
+
+ timestamp with time zone|0s
+ 3
+ 6427
+ 1184
+
+
+ timestamp with time zone|0s
+ 4
+ 6427
+ 1184
+
+
+ text|0s
+ 5
+ 6427
+ 25
+
+
+ text|0s
+ 6
+ 6427
+ 25
+
+
+ text|0s
+ 7
+ 6427
+ 25
+
+
+ boolean|0s
+ 8
+ 6427
+ 16
+
+
+ boolean|0s
+ 9
+ 6427
+ 16
+
+
+ bigint|0s
+ 10
+ 6427
+ 20
+
+
+ id
+ 1
+ 37558
+ 1
+ 6427
+ 1
+ 403
+
+
+ alias
+ 37561
+ 6429
+ 1
+ 403
+ default
+ 100
+ pg_catalog
+
+
+ deleted_at
+ 37560
+ 6428
+ 403
+
+
+ 1
+ 37559
+ 1
+ 6427
+ 37558
+
+
bigint|0s
nextval('passport_third_clients_id_seq'::regclass)
1
@@ -5486,80 +5705,80 @@ false Zulu
37403
20
-
+
timestamp with time zone|0s
2
6238
1184
-
+
timestamp with time zone|0s
3
6238
1184
-
+
timestamp with time zone|0s
4
6238
1184
-
+
text|0s
5
6238
25
-
+
text|0s
6
6238
25
-
+
text|0s
7
6238
25
-
+
text|0s
8
6238
25
-
+
jsonb|0s
9
6238
3802
-
+
jsonb|0s
10
6238
3802
-
+
boolean|0s
11
6238
16
-
+
bigint|0s
12
6238
20
-
+
account_id
37412
6238
1
37314
-
+
id
1
37410
@@ -5568,7 +5787,7 @@ false Zulu
1
403
-
+
alias
37417
6239
@@ -5578,13 +5797,13 @@ false Zulu
100
pg_catalog
-
+
deleted_at
37418
6240
403
-
+
1
37411
1
diff --git a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25/storage_v2/_src_/database/hy_passport.gNOKQQ/schema/public.abK9xQ.meta b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25/storage_v2/_src_/database/hy_passport.gNOKQQ/schema/public.abK9xQ.meta
index 4033bf5..8a7058b 100644
--- a/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25/storage_v2/_src_/database/hy_passport.gNOKQQ/schema/public.abK9xQ.meta
+++ b/.idea/dataSources/74bcf3ef-a2b9-435b-b9e5-f32902a33b25/storage_v2/_src_/database/hy_passport.gNOKQQ/schema/public.abK9xQ.meta
@@ -1,2 +1,2 @@
#n:public
-! [6267, 0, null, null, -2147483648, -2147483648]
+! [6992, 0, null, null, -2147483648, -2147483648]
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 5a32ff0..f73451f 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,11 +4,13 @@
-
+
+
+
+
+
-
-
-
+
@@ -147,7 +149,8 @@
-
+
+
true
diff --git a/pkg/services/realms.go b/pkg/services/realms.go
index 0e1caf4..ffd2cbc 100644
--- a/pkg/services/realms.go
+++ b/pkg/services/realms.go
@@ -57,7 +57,11 @@ func GetRealmWithAlias(alias string) (models.Realm, error) {
return realm, nil
}
-func NewRealm(realm models.Realm) (models.Realm, error) {
+func NewRealm(realm models.Realm, user models.Account) (models.Realm, error) {
+ realm.Members = []models.RealmMember{
+ {AccountID: user.ID},
+ }
+
err := database.C.Save(&realm).Error
return realm, err
}