func CurrentOAuth(c context.Context, scopes ...string) (*User, error) {
	req := &pb.GetOAuthUserRequest{}
	if len(scopes) != 1 || scopes[0] != "" {
		// The signature for this function used to be CurrentOAuth(Context, string).
		// Ignore the singular "" scope to preserve existing behavior.
		req.Scopes = scopes
	}

	res := &pb.GetOAuthUserResponse{}

	err := internal.Call(c, "user", "GetOAuthUser", req, res)
	if err != nil {
		return nil, err
	}
	return &User{
		Email:      *res.Email,
		AuthDomain: *res.AuthDomain,
		Admin:      res.GetIsAdmin(),
		ID:         *res.UserId,
		ClientID:   res.GetClientId(),
	}, nil
}
func CurrentOAuth(c context.Context, scopes ...string) (*User, error) {
	req := &pb.GetOAuthUserRequest{}
	if len(scopes) != 1 || scopes[0] != "" {
		
		
		req.Scopes = scopes
	}

	res := &pb.GetOAuthUserResponse{}

	err := internal.Call(c, "user", "GetOAuthUser", req, res)
	if err != nil {
		return nil, err
	}
	return &User{
		Email:      *res.Email,
		AuthDomain: *res.AuthDomain,
		Admin:      res.GetIsAdmin(),
		ID:         *res.UserId,
		ClientID:   res.GetClientId(),
	}, nil
}
func CurrentOAuth ( c context . Context , scopes ... string ) ( * User , error ) { req := & pb . GetOAuthUserRequest { } if len ( scopes ) != 1 || scopes [ 0 ] != " " { // The signature for this function used to be CurrentOAuth(Context, string). // Ignore the singular "" scope to preserve existing behavior. req . Scopes = scopes } res := & pb . GetOAuthUserResponse { } err := internal . Call ( c , " " , " " , req , res ) if err != nil { return nil , err } return & User { Email : * res . Email , AuthDomain : * res . AuthDomain , Admin : res . GetIsAdmin ( ) , ID : * res . UserId , ClientID : res . GetClientId ( ) , } , nil }
// CurrentOAuth returns the user associated with the OAuth consumer making this
// request. If the OAuth consumer did not make a valid OAuth request, or the
// scopes is non-empty and the current user does not have at least one of the
// scopes, this method will return an error.
CurrentOAuth returns the user associated with the OAuth consumer making this request . If the OAuth consumer did not make a valid OAuth request or the scopes is non - empty and the current user does not have at least one of the scopes this method will return an error .