Move refresh logic to a separate service
Signed-off-by: Nikolai Rodionov <iam@allanger.xyz>
This commit is contained in:
@@ -17,11 +17,15 @@ service PublicAccountsService {
|
||||
service AccountsService {
|
||||
// Is email for the current account verified
|
||||
rpc IsEmailVerified (IsEmailVerifiedRequest) returns (IsEmailVerifiedResponse) {}
|
||||
rpc RefreshSession (google.protobuf.Empty) returns (google.protobuf.Empty) {}
|
||||
// Authorize using long living tokens
|
||||
rpc TokenAuthorization (google.protobuf.Empty) returns (google.protobuf.Empty) {}
|
||||
}
|
||||
|
||||
// Use as a separate service to make it easier to avoid interceptors on the client
|
||||
service RefreshSessionService {
|
||||
rpc RefreshSession(RefreshSessionRequest) returns (RefreshSessionResponse) {}
|
||||
}
|
||||
|
||||
message AccountPassword {
|
||||
string password = 1;
|
||||
}
|
||||
@@ -68,3 +72,16 @@ message IsEmailVerifiedResponse {
|
||||
message RefreshTokenRequest {
|
||||
string session_id = 1;
|
||||
}
|
||||
|
||||
message TokenPair {
|
||||
string access_token = 1;
|
||||
string refresh_token = 2;
|
||||
}
|
||||
|
||||
message RefreshSessionRequest {
|
||||
string refresh_token = 1;
|
||||
}
|
||||
|
||||
message RefreshSessionResponse {
|
||||
TokenPair token_pair = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user