Skip to content

Commit df0e050

Browse files
committed
Add auth.proto file for user registration and login messages
1 parent e3c16ad commit df0e050

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

shared/proto/auth.proto

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
syntax = "proto3";
2+
3+
package geniustechspace.shared.v1;
4+
5+
import "google/protobuf/timestamp.proto";
6+
7+
message UserRegistrationRequest {
8+
string username = 1;
9+
optional string email = 2;
10+
optional string phone_number = 3;
11+
optional string password = 4;
12+
}
13+
14+
message UserRegistrationSuccess {
15+
string user_id = 1;
16+
string message = 2;
17+
}
18+
19+
message UserLoginRequest {
20+
string username = 1;
21+
string password = 2;
22+
}
23+
24+
message UserLoginSuccess {
25+
User user = 1;
26+
repeated AuthToken token = 2;
27+
string message = 3;
28+
}
29+
30+
message AuthToken {
31+
string context = 1; // access, refresh, etc.
32+
string token = 2;
33+
google.protobuf.Timestamp expiry = 3;
34+
}
35+
36+
message TokenPayload {
37+
string user_id = 1;
38+
string token_id = 2;
39+
repeated string scopes = 4;
40+
google.protobuf.Timestamp expiry = 5;
41+
}

0 commit comments

Comments
 (0)