Class LoginServiceImpl

All Implemented Interfaces:
LoginServiceGrpc.AsyncService, io.grpc.BindableService

public final class LoginServiceImpl extends LoginServiceGrpc.LoginServiceImplBase
  • Constructor Details

    • LoginServiceImpl

      public LoginServiceImpl(SoulFireServer soulFireServer)
  • Method Details

    • login

      public void login(LoginRequest request, io.grpc.stub.StreamObserver<NextAuthFlowResponse> responseObserver)
      Description copied from interface: LoginServiceGrpc.AsyncService
      Initiates a login flow for the specified email address.
      If the email is registered, a six-digit verification code is sent to that address.
      The response always indicates that an email code step is next, regardless of whether
      the email exists, to prevent email enumeration attacks.
      Returns:
      - NextAuthFlowResponse with email_code set and a new auth_flow_token
      Errors:
      - RESOURCE_EXHAUSTED: Too many login attempts from this origin
      - UNAUTHENTICATED: Missing origin header
      - INTERNAL: Server error (e.g., database or email sending failure)
      
    • emailCode

      public void emailCode(EmailCodeRequest request, io.grpc.stub.StreamObserver<NextAuthFlowResponse> responseObserver)
      Description copied from interface: LoginServiceGrpc.AsyncService
      Verifies an email verification code to complete authentication.
      The auth_flow_token must match a pending login flow, and the code must match
      the one that was sent to the user's email. On success, returns a JWT token.
      On failure, returns a Failure response with INVALID_CODE reason.
      After successful verification, the auth_flow_token is invalidated and cannot be reused.
      Returns:
      - NextAuthFlowResponse with success set (containing JWT token) if code is valid
      - NextAuthFlowResponse with failure set (INVALID_CODE reason) if code is invalid
      Errors:
      - RESOURCE_EXHAUSTED: Too many login attempts from this origin
      - UNAUTHENTICATED: Missing origin header
      - INTERNAL: Server error (e.g., JWT generation failure)